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
- MYSQL is released under an open-source license. So you have nothing to pay to use it.
- 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.
- MYSQL uses a standard form of the well-known SQL data language.
- MYSQL works on many operating systems and with many languages including PHP, PERL, C, C++, JAVA etc.
- MYSQL works very quickly and works well even with large data sets.
- MYSQL is very friendly to PHP, the most appreciated language for web development.
- 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).
- 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
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.
- 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
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
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.
- CREATE – to create objects in the database
- ALTER – alters the structure of the database
- DROP – delete objects from the database
- TRUNCATE – remove all records from a table, including all spaces allocated for the records are removed
- 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.
- SELECT – retrieve data from the database
- INSERT – insert data into a table
- UPDATE – updates existing data within a table
- 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.
- GRANT – gives user’s access privileges to database
- 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
- commit – to permanently save
- rollback – to undo change
- savepoint – to save temporarily
If you like the article, please do like or comment. Any Suggestions or changes Comment below.Thank You..!!