Suppose we store a lot of diverse information about people data from all kinds of documents, telephones, addresses, etc. Most likely, most of this data will be used very rarely. And often we need only a surname, first name, middle name and phone. Then it makes sense to organize two tables and relate them with a one-to-one relationship. Store frequently used information in one (small) table, and the rest in another. Naturally, tables linked by a one-to-one relationship have the same primary key. For the 먹튀검증 this is important now.
- The relational model defines two general rules for database integrity: object integrity and referential integrity.
- The entity integrity rule is very simple. It requires that the primary keys of the tables do not contain undefined (empty) values.
- The referential integrity rule requires that foreign keys do not contain values that are inconsistent with the parent keys. Returning to the example considered above, we must demand, for example, that students relate only to the class whose number is listed in the “Classes” table.
Most DBMSs can monitor data integrity (of course, this requires appropriate efforts from the developer at the stage of describing data structures). In particular, operations cascading mechanisms are used to maintain referential integrity. Cascading implies, in particular, that when a record is deleted from the “parent” table associated with another table with a one-to-many relationship, all related records are automatically deleted from the “many” table (DBMS itself, without user intervention). And this is natural, because such recordings “hang in the air”, they are no longer connected with anything.
Indexation is extremely important from the point of view of practical application, but optional from the point of view of pure theory. The main purpose of indexing is to optimize (speed up) the search (and, accordingly, some other database operations). Indexing in any case requires additional resources (at the physical level, special index files are most often created). The operations associated with data modification, indexing can even slow down, therefore indexes are usually rarely changed tables, which are often searched.
The index file is very similar to the index of a regular book. For each index value, a list of table rows containing this value is stored. Accordingly, for the search you do not need to view the entire table – just look at the index. But when updating records, you may need to rebuild the index. And it takes extra time.
Of course, there is no question of expounding the theory of relational databases as part of a basic computer science course. Nevertheless, this article is very important for our encyclopedia, because in this case we are dealing with material that cannot be fully presented in the lessons, but the teacher must own it.