|
Chapter 6.3 - Structured Query Language (SQL)
6.3 STRUCTURED QUERY LANGUAGE (SQL) In the database management, it is highly necessary to have one consistent language in which users can express their operation requests at will. In database-speak, a request submitted to a database is referred to a query. Such a language used for user database query is defined as a query language. Among a variety of query languages, Structured Query Language (SQL) is the most widely used one [2, 3]. The formal pronunciation for SQL is "es queue el," though it is often pronounced as sequel. SQL was originally created by IBM, and it has some variants such as Oracle Corporation's PL/SQL or Sybase and Microsoft's Transact-SQL. SQL has become the data query standard which is widely adopted in various database management systems. ODBC defines a standard SQL grammars, which is based on the previous X/Open SQL CAE specification. Applications can submit SQL statements through ODBC. SQL can be classified into several major sub-languages: Data Query Language (DQL), Data Manipulation Language (DML), Data Definition Language (DDL), and Data Control Language (DCL). Distinguished from other procedural languages such as C or Pascal, SQL is a set-based programming language. Certain SQL variants such as PL/SQL are developed to tackle this by adding procedural elements into SQL while keeping SQL's original merits. Another approach is to embed SQL statements into the procedural language code so as to interact with the database. For instance, embedded SQL is supported by the Oracle pre-compilers. The Oracle pre-compilers interpret embedded SQL statements and translate them into statements that can be understood by procedural language compilers. Some commonly used commands used in Data Manipulation Language, Data Definition Language, and Data Control Language are introduced in the following.
SQL defines how to generate and manipulate relational databases on the major platforms including DB2, Ingres, Informix, InterBase, Microsoft SQL Server, MySQL, Oracle, SQLite, Sybase, and so forth. SQL can benefit the users at different levels such as application programmers, database administrators, management, and end users. SQL is able to provide an interface to the relational database, and all SQL statements are instructions to the database. SQL accomplishes all the database operations using a single language. As all major relational database management systems support SQL, the user can transfer the experiences and skills that they have learned from one database to another. In addition, all programs written in SQL can be ported from one database to another without much effort. |
Preface
TABLE OF CONTENTS