Database MySQL Learning (2)

Source: Internet
Author: User

Data types: Data columns, stored procedure parameters, expressions, and data characteristics of local variables.

Plastic:

tinyint: One byte, 128 to 127;2 7-Time Square

SmallInt: Two bytes, 32768 to 32767;2 15-Time Square

Mediuint: Three bytes, 8388608 to 8388607;2 23-time Square

Int: Four bytes, 2147483648 to 2147483647;2 31-Time Square

BigInt: Eight bytes, 9223372036854775808 to 9223372036854775807;2 63-time Square

Floating point number:

float and double can also have (m,d) M as the number of digits, D represents the number of digits after the decimal point, the decimal is the exact value, and the other two are approximate values.

Date and Time type:

Character type:

In addition to the ability to store string data, other data can be stored, compared to slices and sound binary data

Store "ABC", char (6), then "ABC", which is fixed length, varchar (6), then store "ABC", not fixed length.

The Chinese character is a single byte.

Create and view database tables.

Datasheet: It's actually a table with rows and columns.

To create a table:

such as creating this table

Basic syntax

Then the instance operates

Use "Show tables from book" To display the table in this database, if the current database can be ' show tables '

So, the structure of the view table is "show columns from XX;" That's pretty much it.

You can also use describe XX or desc xx to see

Finally, the CREATE statement "show create TABLE xx;" is displayed for the data table.

Database MySQL Learning (2)

Related Article

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.