In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
The project description reads the database table structure definition of the Ecbil project, finds that there are common irrationality, and organizes the special report for the R & D team and DBA team to optimize, and assist in the future table structure definition design. Question: 1 example table structure definition: 2`id`BIGINT (20) UNSIGNED NOT NULL,PRIMARY KEY (`id`) 3`dept _ name` VARCHAR 'organization name 4`dept _ level`VARCHAR (512) DEFAULT NULL COMMENT' organization description '5`type _ level` DECIMAL (4) DEFAULT NULL COMMENT' type hierarchy '6`email _ addr` VARCHAR (128) DEFAULT NULL7`belong _ county` VARCHAR (1024) DEFAULT NULL8`update _ tm` DATETIME DEFAULT NULL9UNIQUE KEY `idx_department_ 1` (`dept_ code`)
KEY `Code` (`code`) 10`cod _ state` char (5) DEFAULT NULL analysis process 1 consult the corresponding system interface input box limit 2 analysis table structure definition solution 1 field definition length is moderately larger than the input box limit of the front page, for example, increase the industry standard of 5% color 10% 2 email address by about 40 characters For example, fields of character types such as belong_county and belong_village, fields of 3type_level, etc., you can choose TINYINT and SMALLINT4 of UNSINGED to set default values for all fields except primary key and business-specific fields. It is recommended that the default value for numeric type fields is 0, and the default value for string type is''empty string. The default value of date type is' 0000-00-the primary key, unique key and foreign key of 00'5MySQL database all have the function of indexing. 6 except for special storage requirements such as birth date, all other date data use TIMESTAMP date type 7InnoDB storage engine with smaller storage space and full time function, it is recommended not to use CHA (N). It is meaningless to directly use the VARCHAR (N) problem cause 1 field definition length to seriously exceed the business demand, and it will also lead to data writing performance problems 2 specifying default values is conducive to simplifying the abnormal complexity of the program and increasing readability. N in 1MySQL database VARCHAR (N) represents multiple characters, different from Oracle and MSSQL, the number of bytes means that the 2DATETIME date type occupies 8 bytes, and TIMESTAMP takes 4 bytes.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.