SQL--Overview

table of Contents

What is SQL?

What are the characteristics of SQL?

 Basic concepts of SQL

SQL syntax


What is SQL?

SQL—Structured Query Language, a special purpose programming language, is a database query and programming language used to access data, query, update, and manage relational database systems.

SQL is a high-level non-procedural programming language that allows users to work on high-level data structures. The user is not required to specify the storage method of the data, nor does it require the user to know the specific data storage method. Different database systems with completely different underlying structures.

The main function of SQL language is to establish contact with various databases and communicate.

SQL is used as the standard language of relational database management systems.

SQL language includes three main types of programming language statements: data definition language (DDL), data manipulation language (DML) and data control language (DCL).


What are the characteristics of SQL?

1. Comprehensive and unified

The language style is unified, and all activities in the life cycle of the database can be completed independently, and the model can be modified at any time as needed, without affecting the operation of the database, so that the system has good scalability.

 2. Highly non-procedural

For data manipulation in SQL language, users only need to propose "what to do" without specifying "how to do". Therefore, users do not need to understand the access path. The selection of access path and the operation process of SQL statements are automatically completed by the system.

3. Collection-oriented operation

The SQL language adopts the collection operation mode, not only the search result can be a collection of primitive ancestors, but the object of an insert, delete, and update operation can also be a collection of primitive ancestors.

 4. Provide multiple usage methods with the same language structure

The SQL language is both a self-contained language and an embedded language. As a self-contained language: it can be used by independent users on-line interaction; as an embedded language: it can be embedded in high-level language programs (for example: C, C++, Java) for programmers to use when designing programs.


 Basic concepts of SQL

Users can query or perform other operations on the base table and view

  • Basic table: a table (schema) that exists independently 
    • Under the relational database management system: a relation corresponds to a basic table
  •  View: a table derived from one or more basic tables (external mode) 
    • Virtual table: itself is not stored in the database, the database only stores the view definition, not the data corresponding to the view 
      • Data: stored in the corresponding basic table
  • Note: You can define the view above the view 

SQL syntax

  • SQL syntax can be written on a single line or multiple lines, ending with a semicolon
  • Use spaces and indentation to enhance the readability of statements
  • MySQL does not distinguish between upper and lower case (uppercase is recommended)

 

Guess you like

Origin blog.csdn.net/weixin_45490023/article/details/106156544