Using workbench to create databases and tables __ databases

Source: Internet
Author: User
MySQL is a relational database management system, its small size, speed, the total cost of ownership is low, and open source, the general development of small and medium Web sites have chosen MySQL as a website database.

here, the MySQL installation is not much said, after installation, MySQL is the use of command-line interface to operate, which for many programmers are not accustomed to, this requires visual tools to operate on MySQL. MySQL has a lot of visual tools, the author is using Workbench, here on how to create a workbench database and tables for a simple demo.

Open Workbench as shown below, click the red box and log in.

Enter the user interface after entering a password.

Click the 1 button to create the database, the 2 interface, enter the database name, click 3 to Apply, create the database.

When the database is created, the database that you just created is displayed on the left

Right-select Create Table on tables

Click the CREATE table to appear on the right side of the interface, design the table.
The red box area is the column name and data type of the design table.
(PK, NN, etc. express meaning please look down, write at the end)
Click on the bottom right to create the table successfully.

Once created, you will be able to create a table under tables, right-click on the table name, select Select Rows to insert data into tables, and select Alter tables to redesign the table.

Now let's talk about the meaning of PK and nn mentioned above

Pk:primary Key Primary
Nn:not NULL non-null
Uq:unique only
Bin:binary binary (larger than text)
un:unsigned unsigned number (non-negative)
Zf:zero Fill Zero, for example, the design column type is int (4), and when the table is created, the input field is 1, then the automatic padding is 0001
Ai:auto Increment Self-increasing

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.