Simple database building and table-building

Source: Internet
Author: User

First enter MySQL at the command line, enter the username and password--:mysql-u user name-p password

And then we can build the database.

First see if you have MySQL database table--:show databases;

Create a database that we need (such as database db)

Now we continue to create the table in the database

At this point our database, the tables have been created successfully

"The above is the database and the establishment of tables, and other SQL statements to operate the MySQL method will continue to increase, to be continued ..."

===============++++++++++++++++++++++++++====================

Delete a table

Increase the fields in a table

In fact, modifying the SQL statements in the base table is--Adding the modified delete field, respectively

"ALTER TABLE < table name >

[Add < new column name > < data type > [integrity constraint]]

[Dpop < integrity constraints;]

[ALTER COLUMN < column name > < data type >]; '

===============++++++++++++++++++++++++++====================

Add the appropriate value to your field: INSERT into table name (Field 1, Field 2, field ...) value (value 1, value 2,...);

Simple database building and table-building

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.