Simple database operation

Source: Internet
Author: User

The first chapter is about MySQL

The database holds a container for organized data. (usually a file or a set of files)

People often use the term database instead of the software they use. This is not true, specifically, the database software should be called the DBMS (database management system ), the database is created and manipulated through the DBMS container. Mouthwash can be a file saved on a hardware device, but it may not. You use the DBMS to access the database instead of yourself.

A Table table is a structured file that can be used to store data of a particular type.

A structured list of data of a particular type.

schema information about the database and the layout and characteristics of the underlying

A field in the column table. The table is made up of columns. The column stores information about a part of the table.

The type of data allowed by the data type. Each table column has a corresponding data type that restricts (or allows) the data stored in that column.

A record in the row table

The primary key is a column (or set of columns) whose value uniquely distinguishes each row in the table.

Although not required, the primary key is generally established. Ease of future data management

Any column in the table can be a primary key, as long as the following conditions are true:

1 Any two rows do not have the same primary key value.

2 Each row must have a primary key value (the primary key value is not allowed to be NULL)

The best habit of the primary key:

Do not update the value of the primary key column

The value of the primary key column is not reused

Do not use values that may change in the primary key column

What is SQL

SQL is an abbreviation for Structured Query language. SQL is a language specifically designed to communicate with a database using classes.

Chapter II Introduction to MySQL

What is Mysql MySQL is a DBMS, which is a kind of database software.

Mysql version Major Changes

4-——InnoDB engine, increased transaction processing, and improved full-text search support

4.1--important additions to function libraries, subqueries, integrated help, and more,

5--stored procedures, triggers, cursors, attempts, and so on.

Chapter III using mysql

Connection

Host name Port a legitimate user user password

Mysql-u root-p-H myserver-p 9999

Select Database

You can use the Using keyword,a keyword in the MySQL language component, and never name a table or column with keywords

Use Dataname;

Show Database list

SHOW DATABASES;

A list of tables within a database (use with access to the database)

SHOW TABLES;

Show can also be used to display table columns

SHOW COLUMNS from column;

DESCRIBE is a quick way to SHOW columns;DESCRIBE Cust;

the other SHOW Statement

Show status displays extensive server status information

Show CREATE DATABASE Displays the MySQL statement that created the specific databases

Show CREATE table shows the MySQL statement that created the specific table

Show GRANTS security permissions for authorized users

Show ERRORS Displays the server error message

Show WARNINGS displays the server's warning message

Simple database operation

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.