Mysql 3: SQL statement Learning

Source: Internet
Author: User

SQL is an ANSI standard computer language used to access and operate database systems. SQL statements are used to retrieve and update data in the database. SQL can work with database programs, such as MySQL, MS Access, DB2, Informix, ms SQL Server, Oracle, Sybase, and other database systems.

Unfortunately, there are many different versions of SQL languages, but to be compatible with the ANSI standard, they must support some major keywords in a similar way (such as SELECT, UPDATE, DELETE, INSERT, WHERE, and so on ). Note: Apart from SQL standards, most SQL database programs have their own private extensions!

The SQL language provides the following functions:

  • Database-oriented Query
  • Data can be retrieved from the database.
  • New records can be inserted into the database.
  • Updatable database data
  • Records can be deleted from the database.
  • You can create a new database.
  • You can create a new table in the database.
  • You can create a stored procedure in a database.
  • You can create a view in the database.
  • You can set permissions for tables, stored procedures, and views.

    A database usually contains one or more tables. Each table is identified by a name (for example, "customer" or "order "). A table contains records (rows) with data ).

    SQL statements are generally in upper case (but not case sensitive) and end with ";", for example:

    SELECT * FROM linuxcast_course;

    Common SQL statements are classified into the following categories:

    • Data Definition Language (DDL)
    • Data Manipulation Language (DML)
    • Data Control Language (DCL)
    • Transaction Control (TCL)

      The most common DML statements in SQL:

      1. SELECT-get data from the database table 2. UPDATE-UPDATE data in the database table 3. DELETE-DELETE data from the database table 4. insert into-INSERT data INTO the database table

      The most common DDL statements in SQL:

      1. create database-CREATE a new DATABASE 2. alter database-modify DATABASE 3. create table-CREATE a new TABLE 4. alter table-change database TABLE 5. drop table-delete TABLE 6. create index-create index (search key) 7. drop index-delete an INDEX

Related Article

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.