Senin, 04 Juni 2012

The SQL Language

The SQL language and relational database systems based on it are one of the most important foundation technologies in the computer industry today. Over the last decade, the popularity of SQL has exploded, and it stands today as the standard computer database language. Literally hundreds of database products now support SQL, running on computer systems from mainframes to personal computers and even handheld devices. An official international SQL standard has been adopted and expanded twice.
Virtually every major enterprise software product relies on SQL for its data management, and SQL is at the core of the database products from Microsoft and Oracle, two of the largest software companies in the world. From its obscure beginnings as an IBM research project, SQL has leaped to prominence as both an important computer technology and a powerful market force.

SQL is a tool for organizing, managing, and retrieving data stored by a computer database. The name "SQL" is an abbreviation for Structured Query Language. For historical reasons, SQL is usually pronounced "sequel," but the alternate pronunciation "S.Q.L." is also used. As the name implies, SQL is a computer language that you use to interact with a database. In fact, SQL works with one specific type of database, called a relational database.

The computer system in the figure has a database that stores important information. If the computer system is in a business, the database might store inventory, production, sales, or payroll data. On a personal computer, the database might store data about the checks you have written, lists of people and their phone numbers, or data extracted from a larger computer system. The computer program that controls the database is called a database management system, or DBMS.

SQL Language

When you need to retrieve data from a database, you use the SQL language to make the request. The DBMS processes the SQL request, retrieves the requested data, and returns it to you. This process of requesting data from a database and receiving back the results is called a database query—hence the name Structured Query Language.

The name Structured Query Language is actually somewhat of a misnomer. First of all, SQL is far more than a query tool, although that was its original purpose and retrieving data is still one of its most important functions. SQL is used to control all of the functions that a DBMS provides for its users, including: 

Data definition. SQL lets a user define the structure and organization of the stored
data and relationships among the stored data items.

Data retrieval. SQL allows a user or an application program to retrieve stored data
from the database and use it.

Data manipulation. SQL allows a user or an application program to update the
database by adding new data, removing old data, and modifying previously stored
data.

Access control. SQL can be used to restrict a user's ability to retrieve, add, and modify
data, protecting stored data against unauthorized access.

Data sharing. SQL is used to coordinate data sharing by concurrent users, ensuring
that they do not interfere with one another.

Data integrity. SQL defines integrity constraints in the database, protecting it from
corruption due to inconsistent updates or system failures.

SQL is thus a comprehensive language for controlling and interacting with a database management system. Second, SQL is not really a complete computer language like COBOL, C, C++, or Java.
SQL contains no IF statement for testing conditions, and no GOTO, DO, or FOR statements for program flow control. Instead, SQL is a database sublanguage, consisting of about forty statements specialized for database management tasks. These SQL statements can be embedded into another language, such as COBOL or C, to extend that language for use in database access. Alternatively, they can be explicitly sent to a database management system for processing, via a call level interface from a language such as C, C++, or Java.

Finally, SQL is not a particularly structured language, especially when compared to highly structured languages such as C, Pascal, or Java. Instead, SQL statements resemble English sentences, complete with "noise words" that don't add to the meaning of the statement but make it read more naturally. There are quite a few inconsistencies in the SQL language, and there are also some special rules to prevent you from constructing SQL statements that look perfectly legal, but don't make sense.

Source : Book "SQL: The Complete Reference"
by James R. Groff and Paul N. Weinberg 

0 komentar:

Posting Komentar