Traditional Culture Encyclopedia - Traditional stories - What is SQL?
What is SQL?
## 1 Second, the data architecture of SQL database < br>
The data architecture of SQL database is basically a three-tier structure, but the terminology used is different from the traditional relational model. In SQL, relational schema is called "base table"; The storage mode (internal mode) is called "storage file"; The sub-mode (outer mode) is called "view"; A tuple is called a row; This property is called a column. The name pair is called 00 100009a:
## 1 III. Composition of SQL Language
Before learning the SQL language formally, let's have a basic understanding of the SQL language and introduce the composition of the SQL language:
1.SQL database is a collection of tables defined by one or more SQL schemas. & ltbr & gt
2.SQL table consists of a set of rows, one row is a series of columns, and each column corresponds to a data item. & ltbr & gt
3. A table can be a basic table or a view. A basic table is a table actually stored in a database, while a view is the definition of a table composed of several basic tables or other views. & ltbr & gt
4. A basic table can span one or more storage files, and a storage file can also store one or more basic tables. Each storage file corresponds to the last physical file stored externally. & ltbr & gt
5. Users can query views and basic tables with SQL statements. From the user's point of view, views and basic tables are the same, and there is no difference. It's all relationships (tables). & ltbr & gt
6.SQL users can be applications or end users. SQL statements can be embedded in programs of host languages, such as FORTRAN, COBOL, PASCAL, PL/I, C and Ada. In an interactive environment, SQL users can also be used as an independent user interface for end users. & ltbr & gt
## 1 Fourth, operate the database.
SQL includes all operations on the database, which is mainly composed of four parts:
1. Data definition: This part is also called "SQL DDL" and defines the logical structure of the database, including defining the database, basic tables, views and indexes. & ltbr & gt
2. Data operation: this part is also called "SQL DML", which includes two operations: data query and data update, among which data update includes three operations: insert, delete and update. & ltbr & gt
3. Data control: The control of users accessing data includes authorization of basic tables and views, description of integrity rules, transaction control statements, etc. & ltbr & gt
4. Rules for the use of embedded SQL language: rules for using SQL statements in programs in the host language. & ltbr & gt
Let's introduce them separately:
##2 (1) data definition
SQL data definition functions include defining databases, basic tables, indexes and views. & ltbr & gt
Let's first understand the basic data types provided by SQL: (for example, 00 1000009b).
Establishment and deletion of 1. database
(1) Establish a database: A database is a data set containing several basic tables, and its sentence format is:
Create database < database name > [other parameters]
Among them, it must be unique in the system and cannot be repeated, otherwise it will lead to data access errors. [Other parameters] vary depending on the specific database implementation system. & ltbr & gt
For example, build a project management database (xmmanage), and its statement should be:
Create database xmmanage & ltbr & gt
(2) Delete the database: delete the database and all its contents from the system. & ltbr & gt
The format of the statement is: drop database & ltbr & gt.
Example: Delete the project management database (xmmanage) with the following statement:
Delete database xmmanage & ltbr & gt
2. Definition and change of basic table
A table that exists independently is called a basic table. In SQL language, a relationship corresponds to only one basic table. The definition of basic table refers to the establishment of basic relational schema, and the change refers to the deletion and modification of existing basic tables in the database. & ltbr & gt
……& lt; br & gt
- Previous article:What's the telephone number of Hebei Bo Tu Storage Equipment Co., Ltd.?
- Next article:Goals and achievements of Liaoning Publishing Group
- Related articles
- What scientific research institutions are there in Henan University of Science and Technology?
- Some suggestions on how to do a good job in employee turnover management by enterprise managers
- What are the positive significance of inheriting and carrying forward Chinese traditional virtues?
- Which clothing brand is JJ that everyone is talking about, confused!
- Intelligent competition intensifies in the second half of "car manufacturing"!
Huawei, Tencent and Baidu have entered the market one after another
- National Treasure Carpet 20 10 of China Iranian Pavilion of Shanghai World Expo
- What is my favorite game writing essay about 300 words
- What is a course? What elements does a course generally contain?
- What are the kindergarten chess clubs?
- Hollow technology is used to design the opening in packaging modeling.