Sql 简明教程

SQL - Overview

What is SQL?

SQL(结构化查询语言)是一种操作数据库的语言;它包括数据库创建、数据库删除、获取数据行、修改和删除数据行等。

SQL (Structured Query Language) is a language to operate databases; it includes Database Creation, Database Deletion, Fetching Data Rows, Modifying & Deleting Data rows, etc.

SQL 代表 Structured Query Language ,它是一种用来存储、处理和检索存储在关系型数据库中的数据的计算机语言。SQL 由 IBM 计算机科学家于 20 世纪 70 年代开发,并于 1986 年成为美国国家标准协会 (ANSI) 的标准,1987 年成为国际标准化组织 (ISO) 的标准。

SQL stands for Structured Query Language which is a computer language for storing, manipulating and retrieving data stored in a relational database. SQL was developed in the 1970s by IBM Computer Scientists and became a standard of the American National Standards Institute (ANSI) in 1986, and the International Organization for Standardization (ISO) in 1987.

SQL 是用于与关系型数据库系统通信的标准语言。所有关系型数据库管理系统 (RDMS)(例如 MySQL、MS Access、Oracle、Sybase、Informix、Postgres 和 SQL Server)都将 SQL 作为其标准数据库语言。

SQL is the standard language to communicate with Relational Database Systems. All the Relational Database Management Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres and SQL Server use SQL as their Standard Database Language.

Why SQL?

SQL 广受欢迎,因为它提供了以下优势:

SQL is widely popular because it offers the following advantages −

  1. Allows users to access data in the relational database management systems.

  2. Allows users to describe the data.

  3. Allows users to define the data in a database and manipulate that data.

  4. Allows to embed within other languages using SQL modules, libraries & pre-compilers.

  5. Allows users to create and drop databases and tables.

  6. Allows users to create view, stored procedure, functions in a database.

  7. Allows users to set permissions on tables, procedures and views.

A Brief History of SQL

  1. 1970 − Dr. Edgar F. "Ted" Codd of IBM is known as the father of relational databases. He described a relational model for databases.

  2. 1974 − Structured Query Language (SQL) appeared.

  3. 1978 − IBM worked to develop Codd’s ideas and released a product named System/R.

  4. 1986 − IBM developed the first prototype of relational database and standardized by ANSI. The first relational database was released by Relational Software which later came to be known as Oracle.

  5. 1987 − SQL became the part of the International Organization for Standardization (ISO).

How SQL Works?

当你为任何 RDBMS 执行 SQL 命令时,系统会确定执行你的请求的最佳方式,而 SQL 引擎会弄清楚如何解释该任务。

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 this process. These components are −

  1. Query Dispatcher

  2. Optimization Engines

  3. Classic Query Engine

  4. SQL Query Engine, etc.

传统的查询引擎会处理所有非 SQL 查询,但是一个 SQL 查询引擎则不会处理逻辑文件。下面是一个展示 SQL 体系结构的简单图表:

A classic query engine handles all the non-SQL queries, but a SQL query engine won’t handle logical files. Following is a simple diagram showing the SQL Architecture −

sql architecture