Database storage structure

       The data storage structure refers to the representation of physical data and logical data in the database, and the description of the relationship mapping method between physical data and logical data. In database technology, objective reality data can be described in two forms: physical data description and logical data description. The conversion between physical data and logical data is achieved through a database management system.

 

1. Physical data description

       Physical data description refers to the way data is stored on the storage device, and physical data is the data actually stored on the storage device. These data are also called physical records. According to the location of physical record storage, it can be divided into ordered storage and disordered storage.

In physical data description, the data description terms used include the following.

       (1) Bit: A unit of binary is called a bit, and a bit can only take 1 or 0.

       (2) Byte: 8 bits are called a byte, which can store a character corresponding to the ASCII code.

       (3) Word: Several bytes form a word. The number of binary digits contained in a word is called the word length. The word length of many computers is different. For example, the word length of a computer can be 8 bits, 16 bits, 24 bits, 32 bits, etc.

       (4) Block: The smallest unit for exchanging information between internal memory and external memory, also known as physical block or physical record. The size of each block is usually 256 bytes, 512 bytes, 1024 bytes, etc.

       (5) Volume: All useful information that can be loaded by an input and output device. For example, a tape of a tape drive is a volume, and a disk group of a disk device is also a volume.

       (6) Unordered storage (unordered): The storage locations of data records are stored in the order of insertion.

       (7) Ordered storage (ordered): The storage locations of data records are sorted in a specified manner.

 

2. Logical data description

       Logical data description refers to the data form that users or programmers use for operations. Logical data is an abstract concept that reflects and records the objective real world. These data can also be called logical records. Logical data contains two levels, one level is the description of the objective reality information world, the other level is the description of the data in the database management system. In describing the objective reality information world, the terms used include the following.

       (1) Entity: what exists in objective reality is described by entity. Entities can be concrete and tangible objects or abstract and intangible objects. For example, a book is a tangible object, and a borrowing process is an intangible object.

       (2) Entity set (entities): The set of similar entities with the same characteristics is called entity set. For example, all books owned by a library are an entity set, and so are all of the library's borrowing processes.

       (3) Attribute: The characteristics of an entity are called attributes. Each attribute has a range of values, which can be of integer type, floating point type, character type or date type, etc. For example, the attributes of a physical book include title, book number, publication date, number of pages, price, and publisher, etc. The value fields corresponding to these attributes are character type, character type, date type, integer type, floating-point number type, and character type. Wait.

       (4) Identifier: An attribute or set of attributes that can uniquely identify each entity. For example, the book number attribute of a book is the identifier of the entity book, and the identifier of the book borrowing process entity includes two attributes: library card number and book number.

       These logical data will eventually be converted into physical data through the database management system. What are the terms used to describe logical data in the database management system? The following takes the relational database management system as an example to introduce.

       (1) Data item: Also known as field, the smallest unit of information that can be named that marks entity attributes. The naming of data items generally adopts the descriptive name of the attribute. These names can be in Chinese, English or Hanyu Pinyin.

       (2) Tuple (tuple): Also known as record (record), a collection of data items is called a tuple. A tuple represents a concrete entity.

       (3) Relation: In a relational database system, the collection of tuples of the same type is called a relation. Relationships are used to describe entity sets, which include all the tuples of an entity set. For example, all books can be grouped into a books relationship.

       (4) Key code (key): In relational database system, the key code called relation can uniquely identify the data item or data item set of each tuple in the relation.

       Figure 5-4 shows the correspondence between logical data and physical data terms. In this figure, the objective entity (book) is described by two layers of logical data, and finally transformed into the actual stored physical data.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326692181&siteId=291194637