2016/3/10 Database simple operation (CREATE database CREATE table numeric type primary key foreign key auto increment)

Source: Internet
Author: User

1, right-click on the root directory under the connection to create the database
Enter the database name, set it up, and click on the page to determine the success of the creation
2. Double-click to open Database
The first of these is the table, the most important and fundamental of the table.
3, CREATE TABLE, find table Right-click, create table.
First of all to determine the column, column name, the database do not use Chinese name to do the column name.
Re-determine the value, type bit Boolean can only store true false

Decimal longer can be defined by its own general float

Char is set to a character length of 1 and can only be 1

varchar is used to store strings that can be set to a length common to 50
Text to save an article about
Binary used to store binary data picture to binary when used but generally the path of storage

4, primary key, foreign key setting. A link between a city table and a table. The foreign key must be disconnected and deleted before the change occurs. After the modification, re-establish. Otherwise you will get an error.

primary key Settings , set the main sequence number. Key is the flag of the primary key

Foreign key settings

Foreign key settings

Auto Increment

2016/3/10 Database simple operation (CREATE database CREATE table numeric type primary key foreign key auto increment)

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.