Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The theoretical basis of SQL

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. Overview

Definition and History of 1.SQL

SQL:Structured Query Language, structured query language. Is the standard language for relational databases; the SQL function is not just a query. Almost all relational database management system software supports SQL. Many software manufacturers have also expanded and modified the basic command set of SQL to varying degrees.

The emergence and development of SQL:

① SQL was proposed by Boyce and Chamberlin in 1974.

At the beginning of ②, SQL was implemented on the prototype of relational database management system System R developed by IBM.

③ SQL was approved as the American standard for relational database language by X3H2, the database committee of the National Standards Institute (American National Standard Institute, referred to as ANSI) in October 1986.

Serial number standard approximate number of pages release date 1SQL/86N/A

October 1986

2SQL/89 (FIPS 127-1) 120 pages

1989

3SQL/92622 page 1992 4SQL991700 page 1999 5SQL20033600 page 2003

Characteristics of 2.SQL

① is integrated and unified; ② is highly non-procedural; ③ has a set-oriented operation; ④ provides multiple ways of use with the same grammatical structure; ⑤ language is concise and easy to learn and use.

Non-relational models (hierarchical model, mesh model) data languages are generally divided into:

Schema data definition language (Schema Data Definition Language, schema DDL)

External schema data definition language (Subschema Data Definition Language, external schema DDL or subschema DDL)

Description language related to data storage (Data Storage Description Language,DSDL)

Data manipulation language (Data Manipulation Language,DML).

SQL integrates the functions of data definition language DDL, data manipulation language DML and data control language DCL. You can complete all the activities of the database lifecycle:

Define relational schemas, insert data, and build databases

Query and update the data in the database

Database refactoring and maintenance

Database security and integrity control.

Highly non-procedural: data manipulation prophets of non-relational data models are process-oriented. To complete a request in this procedural language, you must specify the access path; SQL only needs to propose what to do, but does not need to specify what to do, that is, SQL does not need to know the access path. The selection of access path and the SQL operation process are automatically completed by the system. Set-oriented operation: SQL can not only manipulate objects, search results can make tuple collections, but also insert, delete, update objects can also be tuple collections. Provide multiple uses with the same syntax structure: SQL is both an independent language and an embedded language. In these two ways, the grammatical structure of SQL is basically the same. The language is concise, easy to learn and use: only 9 verbs are used to complete the core function. SQL function verb data query SELECT data definition CREATE,DROP,ALTER data manipulation INSERT,UPDATE,DELETE data control GRANT,REVOKE

Three-level mode of 3.RDBMS database

The outer schema corresponds to the view and part of the basic table; the schema corresponds to the basic table; and the inner schema corresponds to the storage file.

Basic tables: basic tables, like views, are relationships. The base table itself is an independent table, and one (or more) base tables correspond to a storage file. A table can have several indexes, and the indexes are also stored in the storage file.

Internal schema: consists of the logical structure of the files stored in the relational database. The physical structure of the storage file is arbitrary and transparent to the user.

View: a view is a virtual table that stores the definition of a view instead of storing the data corresponding to it in the database. A view is a table everywhere from one or more basic tables.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report