Some basic operations of MySQL database

Source: Internet
Author: User

Here are some of the MySQL operations that are often used to do projects.

1. Operations on the database

View all databases : show databases;

Create a new database : create databases database_name;

When you look at the database again, you can see that there is an extra school library

to be when you operate on a database , you have to use this: using Databases_name;

Delete a database : Drop DB School;

2. Operation of the data table

But first to select a database, that is, using the use of the above said database_name;

added a data table : CREATE TABLE table_name ();

INSERT statement : INSERT into Class () values ();

View Data Sheet : SELECT * FROM table_name;

Modify data Table : Update class set Name= "where id=" ";

data structure of the display table : describe table_name;

Delete a data table : Delete from class where id= "";

This is almost the most basic use of MySQL database and data table operation, other such as modify the table structure, setting delete primary key is not very common. These commands more than a few times, it is easy to remember.

Some basic operations of MySQL 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.