Data Structure - Databases: Design

Data Structure

The most important element of any database, regardless of its representation, is a data structure that reflects possible representations of information for storage, retrieval and processing. Data structures are necessary for working with document data not related to computer processing, and submitted, submitted in automated systems.

In the sense of the terms Data Structure is understood as a unit of information that allows storing and processing many similar and/or logically related data

One of the representations of a data structure can be a form of a document that shows rules for presenting information, reflecting their location, reflection sequence, display rules, view type, etc.

The actual appearance of the term Data Structure is based on the need for documentary submission of information and the emergence of a document as a source and means of communication, which is reflected in the emergence of rules for the processing of documents and submission of information in them.

The structuring of documents, subject to certain rules, allows a person to better understand the features of entering data into a document. For example, the document Sales receipt (Figure 1.7) contains an indication of the need to reflect the name of the organization in the zero "Company". Understanding the essence of this characteristic and the knowledge of the rules for filling accounting documents enables the seller to fill in the field of the document correctly, specifying not only the name of the organization, but also its organizational and legal form in accordance with the data in the constituent and registration documents (charter, certificate of registration of the organization) LLC. ; Electronics .

Fig. 1.7. An example of a data structure in the form of a document

The

Along with the Company field, in the example of the document presented, there are a number of other characteristics - "Date", "Product name", "Quantity", "Price", "Sum", "Total". Some of these characteristics represent independent attributes, suggesting an indication of data unrelated to other characteristics. Some characteristics ("Product name", "Quantity", "Price", "Amount") are interrelated attributes characterizing the sold goods and presented in a certain structure, letting the seller know that it is necessary for each product to indicate additional characteristics, related to it, revealing full information about the conducted trading operation. In this case, it is worth noting that one of the characteristics ("Summa") is a calculated characteristic, depending on the values ​​of the two characteristics in the row of the table ("Quantity", "Price"). This characteristic is calculated by a well-defined formula by multiplying the value of the column Quantity to the value of the column Price within each filled row of the product data table.

Another characteristic ( Total ) that is present in the document has special properties. This characteristic, located at the bottom of the table with the data on the goods sold, tells the seller about the need to calculate the total amount of all the goods sold, forming aggregate financial information. It is necessary to pay attention to the placement and form of presentation of this characteristic. The structure of the data of the document will make it clear that in this case only one aggregated characteristic should be reflected, and since the document refers to financial information, this characteristic reflects financial information - the total amount but sold goods.

However, if this characteristic is added to the table structure and divided into the corresponding column table ("Quantity", "Sum"), the characteristic will change its essence and appear in the form of a group aggregated characteristic that specifies the total number of units sold (if this operation is possible, taking into account the unit of measurement of the quantity of the goods) and the total cost. Naturally, when reading the structure of the document, the seller, based on the conditions and rules of working with the document, fills only those values ​​with the relevant characteristics that are objectively appropriate for filling.

Thus, the data structure of the "Goods receipt" document, taking into account the rules for the reflection and processing of individual information in this structure, will give the seller an exhaustive information about the data entered into the document.

The document shows that a number of elements that reflect the components of such structures are used to describe data structures. One of these elements is the attribute, which, however, to the extent of the development of data technology has become a basic one, reflecting the characteristics of the information.

The term Attribute understand the necessary existence of an object property.

This definition is generally used from the philosophical point of view, but it reflects the essence of the term in its general sense. Distributing it to work with data, we can talk about its consideration as the main element that allows, taking into account knowledge and subject area, to describe not only the characteristic essence of the object, but also reflect the form and features of the presentation. Of course, not every characteristic of an object can be interpreted so unambiguously by an attribute, but with the proper naming of an attribute, it is usually possible to do this.

Thus, in terms of working with data under the term Attribute it is necessary to understand the characteristic property of the object, reflecting the individual meaning of the object.

Correct selection of attributes for describing the characteristics of an object is one of the most difficult tasks in the development of databases, because it is often difficult to determine the necessity of using a particular characteristic when presenting data about an object.

So, for example, when considering an object "Item" the question arises whether it is necessary to reflect such characteristics in the database: "Name", "Article", "Purchase price", "Quantity of delivery", "Color", "Size" etc. Obviously, several factors influence the choice of the attributes used: the types of goods for storing data (shoes, clothes, computers, products, etc.), the purpose of data storage (analytical processing of goods receipts, accounting of available goods in a warehouse or in a store, publication of a catalog of goods, etc.), many others.

In addition, it is important that the name of the attribute is correct, which makes it possible to unambiguously interpret the attribute specified in the attribute without unnecessary additional analysis. As a rule, in the analyzed documents, while creating the database, the necessary names have already been indicated, but the document presents an integral data structure that allows you to accurately isolate the necessary characteristics of the object.

For example, in the document in Fig. 1.7 document attribute Price can be unambiguously interpreted as the "Selling price", although it is not written in the document itself. You can determine this from the very structure of the document. This attribute is placed in the document "Goods receipt", which is issued to the customer when the goods are sold, which means that speech in the document will be about the goods being sold. Also this attribute is placed in the document within the table, where other attributes are placed alongside and related to it: "Name", "Quantity", "Sum". In view of the fact that the speech in the document is about the goods, which are the main elements of the data, the possible values ​​in the table of the document are clearly clear. Because one of the row attributes in the table is the Name characteristic, when you examine the "Price" attribute, it becomes clear that this is the price of the goods indicated by their name in the corresponding row of the table. As a result, the interpretation of the Price is understood unambiguously.

But to represent an attribute in a database, such an attribute name can not be possible because it is affected not only by the location (the essence of the database model), but also by the placement of other attributes in the same entity (Figure 1.8).

Fig. 1.8. Example of specifying attributes in entities

The

Imagine that, in essence, the database model is Item in stock two attributes are specified: Price and Date & quot ;. Entity name Product in stock makes it possible to understand that the relevant element of the database will contain information about the goods that are placed in the warehouse, but there is no indication of what status these goods will possess: purchased, sold, re-accounted, etc. The presence of the Date does not give an unambiguous interpretation of the essence of the goods being considered, since under this attribute one can understand the date of acquisition, the date of disposal, the date of rediscount, etc. In the same undefined state is the attribute "Price". In order to understand the meaning of these two characteristics, it is necessary to return to the analysis of the subject area and understand the essence of the tasks for the information system.

Specify the specified attributes and add a new attribute associated with the "Date (Figure 1.9). Now the attribute Purchase price allows us to understand that this attribute is unambiguously interpreted and reflects the chain by which the goods were purchased, and the attribute "Date" has nothing to do with him and characterizes the revaluation of goods in a certain period. Add the Current price specifies the description of the object Product in stock & quot ;. In the previous version of the model, it was impossible to specify this attribute without adding it to the term current & quot ;. The ego would lead to the appearance of two attributes with identical names, which will only complicate the understanding of the essence of the stored data. Specifying an attribute in the name Current price in conjunction with the Revaluation Date can be clearly interpreted in the understanding that information on the current price of the goods at the time of its revaluation will be stored here, and the purchase price for all revaluation dates of the goods will remain unchanged.

Another element of the data structure in the document is the "Data Type". This element is not explicitly represented in the document, but the understanding of the domain and the logical analysis of the attributes used make it possible to be sure with certainty which data

and what type should be presented in the appropriate places in the document.

Fig. 1.9. Specifying attributes in the entity

The

In fact, the data type defines the form and rules for presenting certain data. As a form, the data type determines the possible use of symbols in writing data. For a line and text, any symbols from numbers to letters and special characters can act as such. For a numeric data type, only digits and the & quot ;, as a separator of the whole and fractional part. A logical data type can be represented in different ways, depending on the DBMS chosen: Truth or False & quot ;, True or False & quot ;, 1 or 0, and so on. Rules for the data type determine the laws by which the data should be output to a document or to a computer screen. For a character-numeric data type, such a rule may be the need to output a numeric value with the ability to represent the leading character "O" (for example, the bank NIC is represented by the value 044525225 ).

Under the Data Type we mean a characteristic property of an attribute that defines the form, size, and rules of data representation.

If you consider the attribute "Company", then, taking into account the peculiarities of the data representation about the organization, the developer will unambiguously determine the need for data representation in the form of a test line containing at least the name of the organization, and additionally an organizational and legal form (for example , OOO Kettle ). Of course, even in this simple example, there is unambiguousness in understanding how specific data should be presented, but the "Data Type" it is possible to define what makes a clearer understanding of the data structure used.

For the Company attribute The representation is unambiguous, but for certain attributes in documents, it is not always possible to uniquely determine the data type. For example, consider the attribute of the Total document. This attribute, if you do not know the specifics of filling out the document, "Cash receipt" and the rules for presenting financial information in the summary line, can be represented by any of two types of data: a text string or a real number with two signs after the decimal point. It is worth paying attention to the description of the numeric data type for this attribute. It seems to be a fairly large set of characteristic features, which allows you to accurately understand the rules and form of data representation. In some DBMS, a monetary data type is used to reflect financial information, which is a derived type from a real data type with a specified accuracy. Typically, the value of the sum attribute is customary to be written with such a numerical value (for example, 25,637.54 ).

However, for financial documents, there is a rule in the subject area that the totals should be written with a symbolic value (for example, twenty-five thousand six hundred thirty-seven rubles 54 kopecks). Here, it is the data type of the text string that is used, given the need to use alphabet characters with the inclusion of numeric characters. Running a bit ahead, it's worth noting that such a representation of the document data is not usually stored in the database, it is represented by a numerical value, and the display in a printed or electronic document in the form of a text string is performed based on the program rules for the text representation of a numerical value. Thus, the understanding of the domain allowed to more accurately determine the correctness of the data representation in the document and to determine the type of data that describes the Total in the Sales receipt document.

Considering data structures as illustrations and data representation models in information systems, developers use the data structures presented in documents, but they build them in such a way that in the implementation it is possible to use the snoring and processing software tools, which include the DBMS. There is a fairly large number of data models that are used to describe data structures: hierarchical, network, relational, post-relational, object-relational, object, etc.

Also We Can Offer!

Other services that we offer

If you don’t see the necessary subject, paper type, or topic in our list of available services and examples, don’t worry! We have a number of other academic disciplines to suit the needs of anyone who visits this website looking for help.

How to ...

We made your life easier with putting together a big number of articles and guidelines on how to plan and write different types of assignments (Essay, Research Paper, Dissertation etc)