Use MySQL workbench to build a database, create a new table, add data to a table

Source: Internet
Author: User

A beginner's database, a record of what you've learned. I used the MySQL database to manage with MySQL Workbench. Here's a quick introduction to using MySQL Workbench to build a database, create a new table, and add data to a table.

Click on the "Plus" icon to create a new connection,

For example, first enter the database account password, account default is root, fill in the Password and click "OK", the connection is established, after the completion of the establishment, there will be a rectangular box, double-click it, appear the page shown

Click the button in the red circle in the image to create a new schema, the database (personal understanding). ), modify the value of name, such as MyDatabase, click Apply, then point to apply, then click Finish as shown

The database is built!!!

The next step is how to create a table

First to be!!!    Double click!!! Just set up the database MyDatabase, and then create the table, otherwise it will be wrong, right click on tables and then click Create New tables, fill in the table name, and the table column information, then click Apply, a table is completed

Pk:primary Key (column is part of a PK) primary key

Nn:not Null (column is nullable) is empty

-uq:unique (column is part of a unique key) foreign key

Ai:auto Increment (the column is auto incremented if rows are inserted) automatically increases

Bin:binary (if DT is a blob or similar, this indicates is binary data, rather than text) binary

un:unsigned (for-integer types, see docs: "10.2.) Numeric Types ")

-Zf:zero fill (rather a display related flag, see docs: "10.2. Numeric Types ")

The following page appears

Next, add data to the built-in tb_student table.

Right-click Tb_student, and then click Select Rows Limit 1000

Adding data to a table in a database is roughly what it looks like in MySQL Workbench.

There is nothing wrong with the above, but also ask the great God for advice.

Use MySQL workbench to build a database, create a new table, add data to a table

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.