Base operation of the front-end learning Database

Source: Internet
Author: User

Previous words

SQL is a standard computer language that is used to access and process databases in ANSI. However, there are many different versions of the SQL language, and in order to be compatible with ANSI (American National Standards Institute) standards, they must collectively support some key keywords (such as SELECT, UPDATE, DELETE, INSERT, where, etc.) in a similar way

RDBMS refers to relational database management systems, which are the basis of SQL and are also the foundation of all modern database systems, such as Oracle, MySQL, and access. Data in an RDBMS is stored in a database object called a table (tables). A table is a collection of related data items that consists of columns and rows

The basic operations of the MySQL database are described below

Sign Out

The first step in manipulating the database is to log in to the database, typically providing a MySQL username and password. If the server is running on a machine other than the logon server, you also need to specify the host name

[note] After exiting the database, CMD clears the screen by entering the CLS (equivalent to clear screens)

The parameter           description-D (Database            ) opens the specified databases-h (            host) server name            -p (password) password-p (            port) port number-u            (user) Username-v            ( Version) output the release information and exit

MySQL database exit There are three ways, namely exit; quit; \q;. Choose one of the following

Statement specification

Before operating the database, you should first understand the statement specification of the database, the following three main

1. keyword and function name all uppercase

2. Database name, table name, field name all lowercase

3. The SQL statement must end with a semicolon

Common commands

The MySQL database has the following three common commands

SELECT VERSION ();         Displays the current server version select Now ();             Displays the current date time select USER ();            Show Current User

[note] Use the Delemiter statement to modify the Terminator

The Terminator is a two slash delemiter////Terminator is a point number delemiter.

Database operations

The first step in database operations is to create a database

CREATE {DATABASE | SCHEMA} [IF not EXISTS] db_name [DEFAULT] CHARACTER SET [=] Charset_name

Creating a database does not mean that it is selected and used and must be explicitly manipulated, so the second step in database operations is to select the database

Use Db_name

Below, let's look at the list of databases under the server

Sometimes we need to modify the database

ALTER {DATABASE | SCHEMA} [Db_name] [DEFAULT] CHARACTER SET [=] Charset_name

Finally, the operation to delete the database

DROP {DATABASE | SCHEMA} [IF EXISTS] Db_name

Then look at the list of databases under the server

-Reprint

Base operation of the front-end learning Database

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.