"My Database Learning Journey (i)"-----SQL Learning

Source: Internet
Author: User

SQL (Structure query Language, Structured Query language) was proposed by Boyce and Chamberlin in 1975 to implement query, selection and other operations in relational operations. As a standard language for relational database operations, it has been formally approved by ANSI (National Standardization Organization of America) as the industry standard for databases. SQL is a collection-oriented operation language, which is a collection of tuples that manipulate objects and the results of operations.

The SQL language can be divided into 3 categories by function: DDL, DDM, and DCL, as described below.

1.DDL

The DDL (data definition Language) is used to create, modify, and delete database objects, and some of the commonly used SQL statements are as follows

1) CREATE DATABASE: Creating databases

2) Create tablespace: Creating table Spaces

3) CREATE TABLE: Create tables

4) CREATE VIEW: Creating views

5) CREATE INDEX: Create indexes

6) ALTER DATABASE: Modify databases

7) Alter tablespace: Modify table Space

8) ALTER TABLE: Modify tables

9) Drop database: delete databases

Drop tablespace: Delete table space

drop TABLE: Delete tables

Drop View: Delete views

Drop INDEX: Delete indexes

2.DML

DML (data manipulation, Language) is used to manipulate data in a database, including some SQL statements such as the following

1) Select: Querying data in the database

2) Insert: Insert data into the database

3) Update: Updates the data in the database

4) Delete: Delete data from the database

3.DCL

The DCL (Data Control Language) is used to control access to the database, including some SQL languages as follows

1) Grant: Authorized user permission to manipulate database objects

2) REVOKE: Revoke the authorization to the user

3) Commit: Commit transaction, for transaction processing

4) ROLLBCK: ROLLBACK TRANSACTION for transaction processing

5) Lock: Locks a portion of the database until a transaction is complete and is used for concurrency control.

Querying data using the SELECT statement

The SQL language uses the SELECT statement to implement any query to the table, including selecting rows or columns that match the criteria and other actions.

Common SELECT Syntax:

Select field 1, Field 2, ...

From table 1 [, table 2] ...

where query criteria

Group by Group Field 1[, Group Field 2] ... having group conditions

Order BY column [, column 2] ...

My Database Learning Journey (i)-----SQL learning

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.