The differences between int, bigint, smallint and tinyint in MySQL in Navicat software, Boolean type storage and garbled problem solving

Source: Internet
Author: User

A long time not to write blog, has been busy in this school game has forgotten to update the blog. The new task starts again, we must prepare "2017 Chinese university student computer design competition software Service Outsourcing competition". This time can not imagine that there is a PC-side function as a reference, this time really is to do nothing, although the process must be a bit difficult, but think if the success of the words will certainly be benefited. Today is my first day of war, the analysis function to build a database, do not know whether the database is established perfect but in this database is really learning to learn the knowledge. I will write down the problems I have encountered, and then my solution is to help you to meet the same problem.

First of all, the software I use is:

Next is our database E-r sketch:

Here we begin to build the database with the software, here is the table chart we built according to the E-r diagram:

The admin table is designed to:

The department table is designed to:

The meet table is designed to:

The table is designed to:

The source table is designed to:

The staff table is designed to:

Does it feel like I've built it? In fact, I also think I was built, until my study brother asked me a question, I found that I did not notice some of the details. The next thing I cut was the problem of his setting up the database and the details I didn't notice.

See that question mark, this is caused by inconsistent coding. Click on the table name will appear the following picture shows the result: comparison to see your coding is not utf-8?

The default state character encoding is Latin1:

If not, this time you need to set the encoding format to Utf-8. However, the database encoding format cannot be changed when the database is open, only in the shutdown state.

But after you've changed the code, your table is still garbled. That's because of this: click on the attribute you created to see if the encoding of the property is not utf-8, if not changed.

Through the above method our final structure is:

Database type:

bigint (storage byte is 8 bytes)

A byte is a 8-bit binary, so the value range is:

Integer data (all numbers) from -2^63 (-9223372036854775808) to 2^63-1 (9223372036854775807). The storage size is 8 bytes.

int (storage byte is 4 bytes)

The values range from:

Integer data (all numbers) from -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647). The storage size is 4 bytes. The SQL-92 synonymous word for int is integer.

smallint (storage byte is 2 bytes)

The values range from:

Integer data from -2^15 (-32,768) to 2^15-1 (32,767).

tinyint (storage byte is 1 bytes)

Integer data from 127 to 128.

Stores the Boolean type of the worthy Word type to select a bit.

The differences between int, bigint, smallint and tinyint in MySQL in Navicat software, Boolean type storage and garbled problem solving

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.