SQL is the acronym for Structured Query Language.
It is a query language that can be used
to write queries to create schema, store, manipulate, and retrieve data from the
relational database.
It is developed by Donald D. Chamberlin and Raymond F. Boyce at IBM in the early 1970s.
SQL is also pronounced as 'Sequel'.
SQL is a de-facto standard. It is also standardized by ANSI(American National Standards
Institute) in 1986 and ISO(International Organization for Standardization) in 1987. It is to be
noted that the queries can only be written using SQL, but we need some RDBMS(Relational
Database Management Systems) like SQL Server, Oracle to execute those SQL commands and
queries.
SQL is further divided into four sub-languages, that are as follows:
1. DDL(Data Definition Language): DDL is used to specify the relational
database schema, which is usually hidden from the database users. Some DDL
commands are CREATE, DROP, ALTER, TRUNCATE, etc.
2. DML(Data Manipulation Language): DML enables a database user to access or modify
the data stored in the database that is organized by appropriate data models. Some of
the DML commands are SELECT, INSERT, UPDATE, DELETE, etc.
3. DCL(Data Control Language): DCL is a language used to control access to data stored
in the database. Some of the DCL commands are GRANT, REVOKE, etc.
SQL Server, also known as MS SQL Server is an RDBMS(Relational Database Management
System). It is an application that stores the database data and executes the SQL commands and
queries to manipulate the relational database
There are some other RDBMS also available like Oracle, DB2, etc.
It has both command-line and GUI(Graphical User Interface) for providing better user
operations. Also, the SQL Server has frequent security and operational updates that make it
more popular.
Difference between Mysql and SQL(Ms SQL)
1) Developers
SQL is developed by Microsoft Corporation and named as Microsoft SQL Server (MS SQL). On
the other hand, MySQL is developed by Oracle Corporation. Its name is a combo pack of "My
(under co-founder daughter's name) and Structured Query Language (SQL)".
2) Availability
MySQL is open-source software, which is available free to all. In contrast, SQL is not an open-
source software and hence not available free of cost.
3) Platforms support
SQL was initially developed for the Windows operating system. Currently, it is supported
by Linux and macOS (via Docker), lacking certain features that are supported in the Windows
platform. While MySQL works well with Windows, macOS, Linux, Solaris platforms.
4) Programming Languages Support
MS SQL itself is a programming language, but the SQL Server supports basic programming
languages such as C++, Go, R, PHP, Python, Ruby, Visual Basic, etc. In addition to the basic
programming languages, MySQL also supports Perl, Haskel, Tcl, etc.
5) Storage Engine
MySQL does not require a large amount of storage space for performing different operations. It
supports multiple storage engines. MySQL also supports plug-in storage engines. On the other
hand, MS SQL supports only a single storage engine. Therefore, programmers need to be
updated with more improved engines.
6) Security Offered
MySQL is a less securable server because it allows database files manipulation by other
processors or its own binaries at its execution time only.
But, MS SQL provides a highly securable job. It does not allow database file access or
manipulation through other processors or its own binaries at its execution time.
7) Backup
In MySQL, for data backup, the developer needs to extract it as SQL statements. While backing
up the data, the server blocks the database, which reduces the chance of data corruption when
switching from one version of MySQL to another.
In MS SQL, the server does not block the database at the time of backup. It means while data
backup, the developer can perform other operations on the database.
8) Time Consumption in Data restoration
MySQL consumes a high amount of time for data restoration because it executes multiple SQL
statements altogether, while MS SQL makes less effort and time to restore a huge amount of
data.
9) Canceling Query Execution
MySQL does not provide the facility to stop or cancel a query at its execution time. To do so, the
user needs to cancel the whole process. Unlike MySQL, the MS SQL server provides the feature
to truncate a query at its execution time without disturbing or canceling the entire process.
10) Software Stack Component
The enterprise can select various editions of MS SQL according to the user requirements for the
project. On the other hand, MySQL is used by many web application developers as a component
of the LAMP stack.
11) Editions
There are two editions available in MySQL. The user can either use MySQL Community Server
or MySQL Enterprise Server. Whereas, MS SQL is available in various specialized editions. The
user can select from the web, enterprise, standard, or Express editions of SQL.
12) Multilingual
MySQL is available only in the English language. In contrast, SQL is available in many different
languages.
13) Syntax
The SQL syntax is easy to use and implement. On the other hand, MySQL syntax is a little bit
typical to use and implement.
For example,
If we want to implement the length function, the following queries will be used as per:
1. MS SQL: SELECT LEN(req_string) FROM <Table_name>
2.
3. MySQL: SELECT CHARACTER_LENGTH(req_string) FROM <Table_name>
DDL Commands
DDL stands for Data Definition Language. It consists of the SQL commands that can be used
to define the database schema. It deals with descript tions of the database schema. These
commands are used for creating, modifying, and dropping the structure of database objects.
The database automatically commits the current transaction before and after every DDL
Command. Some DDL commands are CREATE, ALTER, and DROP.