In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, Xiaobian will bring you about the composition of the data tables in the database. The article is rich in content and analyzed and described from a professional perspective. After reading this article, I hope you can gain something.
In a database, a data table is composed of three parts: the table name, the fields in the table, and the records in the table. Before creating a table, you must first design its structure, which describes the framework of a table. Designing a table structure is actually defining the number of fields that make up a table, and the name, data type, and length of each field.
Before creating a table, you must first design its structure, which describes the framework of a table. Designing a table structure is actually defining the number of fields that make up a table, and the name, data type, and length of each field.
Designing the data table structure is to define the file name of the data table, determine which fields the data table contains, the field name, field type, and width of each field, and enter these data into the computer.
Structure of Design Tables
1. Determine the table name. The name of the table should ensure its uniqueness, and the name of the table should be consistent with the purpose, simple, intuitive, and known by name.
2. Determine the field name.
(1) The field name length is less than 64 characters.
(2) Field names may include letters, Chinese characters, numbers, spaces and other characters.
(3) Field names may not include periods (.), exclamation mark (!), Square brackets ([]) and accents (,).
(4) Field names may not begin with leading spaces.
3. Determine the field type. Access provides 10 data types to meet the different needs of fields.
4. Determine field attributes. Such as field size, formatting, default values, required fields, validation rules, validation text, and indexes.
5. Determine the primary key field in the table that uniquely identifies the record, i.e., the primary key.
data type
There are 10 types of data commonly used in databases.
text type
Text is the default data type, up to 255 characters, and the default length is 50 characters. You can set the maximum number of characters allowed in a Text field by setting the Field Size property. When the text contains Chinese characters, one Chinese character only occupies one character. If the length of the data entered does not exceed the defined field length, only the characters entered into the field are saved, and the contents of unused positions in the field are not saved. Text types are usually used to represent words or numbers that do not need to be calculated, such as names, addresses, student numbers, and zip codes.
memo
Memo type allows storage of up to 65,535 characters, essentially the same as text type data, suitable for storing information describing things in detail, such as personal resume, notes and summaries.
digital type
Data composed of numbers 0~9, decimal point and sign, used for arithmetic operation. Numeric field is subdivided into integer, long integer, byte type, single precision type and double precision type. Its length is set to 2, 4, 1, 4 and 8 bytes respectively by the system.
The default numeric field length is long integer. The single-precision type is accurate to 7 decimal places, and the double-precision type is accurate to 15 decimal places. Byte types can only hold integers from 0 to 255.
date-time type
Used to represent any combination of date and time between 100 and 9999. The format in which date/time data is stored and displayed depends entirely on the user-defined format. According to different storage and display formats, it is divided into regular date, long date, medium date, short date, long time, medium time and short time. The system defaults to 8 bytes in length.
currency
Used to store monetary values. Currency symbols and thousand-digit separators are automatically added when data is entered into this field, and the format in which currency data is stored and displayed depends entirely on the user-defined format. According to the different storage and display formats, it is divided into conventional data, currency, euro, fixed and standard types.
The maximum length of the integer part of monetary data is 15 digits, and the length of the decimal part cannot exceed 4 digits.
automatic numbering type
Used to store incremental and random data. When adding records to a table, the system assigns a unique sequence number to the field, which can be determined incrementally or randomly.
Increment method is the default setting. For each new record, the value of this field will automatically increase by 1.
When using random methods, for each new record added, the data for that field is assigned a random long integer.
Once the value of this field is specified by the system, it cannot be deleted or modified. Therefore, for tables containing fields of this type, the following issues should be noted during operation:
(1)If a record is deleted, the value of that field in other records will not be adjusted;
(2)If a new record is added to the table, the field does not use the value already used in the deleted record;
(3)The user cannot specify or modify the value of this field.
Only one automatic numbering field is allowed in each data table, and its length is set to 4 bytes by the system, such as sequence number, commodity number and code.
Yes\No type
Data used to determine whether a logical value is true or false, expressed as Yes/No, True/False, or On/Off. The field length is set by the system to one byte. Such as whether to pass, marriage, etc.
OLE object type
OLE(Object Linking and Embedding) is used to link or embed objects created by other applications. For example, embedding sounds, pictures, etc. in a database can be up to 1GB in size.
Link and embed the way in the input data can be selected, link object is to represent the file content of the picture inserted into the document, the database only save the picture and the link to the source file, so that any changes to the source file can be reflected in the document; and embedded object is the file content as an object inserted into the document, the object is also saved in the database, then the inserted object is irrelevant to the source file.
hyperlink type
Used to store hyperlink addresses, linked to the Internet, local area network or local computer, the size does not exceed 2048 bytes.
consult wizard
Use to create a lookup wizard field that allows users to lookup values in other tables or other fields in this table using list boxes or combo boxes. Usually 4 bytes.
The above is what the data tables in the database shared by Xiaobian are composed of. If there are similar doubts, please refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.
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.