- Data redundancy reduction: Data is shared by many departments
stored in one place in a unified structure.
- Compatibility: Eliminating redundancy results in compatibility.
prefer.
- Data integrity: Ensures certain integrity constraints. When a user
Maybe you are interested!
-
Database Programming - Hanoi Industrial Vocational College - 22 -
Database Programming - Hanoi Industrial Vocational College - 1 -
Database Programming - Hanoi Industrial Vocational College - 14 -
Computer Structure - Hanoi Industrial College - 15 -
SQL Database Administration - Hanoi University of Business and Technology - 14
When using insert, delete, or edit, constraints must be strictly checked.
- Data security: Ensuring data security and information confidentiality is important.
- Data synchronization: Usually the database is accessed by many users at the same time. There needs to be a mechanism to protect against incompatibility (both booking ₮ seats do not match)
- Data independence: The separation of the structure that describes the data from the application program that uses the data is called data independence. This allows the data organization to evolve without modifying the application program.
1.4. Objects using the database
The user is the person who exploits the database through the management system.
Database. Can be divided into 3 types of objects: Database administrators, application developers and programmers, end users.
- Database administrator: Is the person responsible for daily management and maintenance of the database such as:
+ Accuracy, integrity and security of data and applications in the database.
+ Backup and restore database.
+ Keep in touch with application developers and programmers, end users.
+ Ensure the effective operation of the database and database management system
- Application developers and programmers: are IT professionals responsible for designing, creating and maintaining the final information for users.
- End users are non-specialists in the field of information technology, they are experts in other fields with specific responsibilities in their work. They exploit the database through programs (application software).
built by the application developer or the system's query engine
database management
1.5. Database Management System
To solve the problems that the database organization poses as mentioned above, it is necessary to have specialized software to exploit them. These software are called database management systems. Database management systems have the task of supporting database design analysts as well as database operators. Currently, on the software market, there are database management systems that support many utilities such as: MS Access, Visual Foxpro, SQL Server Oracle, ...
Each database management system is implemented based on a specific data model. Regardless of the data model, a database management system must meet the following factors:
- Communication language between users and the database, including: Data description language: To allow declaring the structure of the database, declaring data relationships and management rules imposed on that data. Data manipulation language: Allows users to update data (add/edit/delete). Data query language: Allows users to query necessary information in the database. Data management language: Allows system administrators to change the structure of data tables, declare information security and grant database exploitation rights to users.,...
-Data dictionary: Used to describe link mappings, record structural components of the database, application programs, codes, permissions, etc.
-Mechanism to resolve data contention issues: Each database management system can also install its own mechanism to resolve these issues. The following measures are often used: first: grant priority to each person
use; second: Mark data access requests, time division,
Whoever requests first has the right to access the data first,…
-The database management system must also have a mechanism to backup and restore data when an incident occurs. This can be done after a certain period of time, the database management system will automatically create a copy of the database, this method is a bit expensive, especially for large databases.
-The database management system must provide a friendly, easy-to-use interface.
use
1.6. Applications of Databases
Nowadays, databases are almost associated with all applications of information technology; such as information system management in government agencies, information storage and processing in enterprises, in scientific research fields, in teaching, as well as in organizing multimedia information, etc.
2. Data models
Data models are abstractions of the real environment. Each type of data model represents a different approach to data for database design analysts. Each type of data model has its own advantages and limitations, but there are still outstanding data models that attract a lot of research interest.
Next we will review the history of data model development.
In the sixties, the first generation of databases came into existence in the form of entity relational model, network model and hierarchical model.
In the seventies, the second generation of databases was born. That is the relational data model invented by EF. Codd. This model has a tight logical structure. This model has been and is being widely used in management work on a global scale. The study of the relational data model aims at the theory of normalization of relations and is an important tool in
analysis and design of current database systems. The purpose of this study is to
Remove abnormal elements of the relation when performing updates, remove redundant elements.
In the eighties, the third database model was born, which is the object-oriented database model, the distributed database model, the deductive database model, etc.
In the following section, we will present the most typical data model for designing (initial) an IT application, which is the entity-relationship model. In the remaining chapters of this textbook, we will present the relational data model.
3. Combined entity model
Currently, the relational data model is often used in database management systems, this is a physical data model. To establish this model, it is often necessary to use a conceptual data model to specify, one of the models in that form is the entity association model (then use some rules to convert the system from this model to the relational data model - these rules will be discussed in section 2.2).
Following are the concepts of the entity relationship model.
3.1. Entity
An entity is an existing and distinguishable thing, for example student Nguyen Van Thanh, class 2A of Information Technology College, subject of Database, motorbike with registration number 52-0549,... are examples of entities.
3.2. Attribute
The individual characteristics of an entity are called attributes.
For example, the attributes of student Nguyen Van Thanh are: code, student, gender, date of birth, permanent residence, class currently attending, ... (In this textbook, attribute names are written in capital letters)
3.3.Entity type
A set of entities that have the same attributes. Each entity type must be given a meaningful name. An entity type is represented by a rectangle.
For example, students with student codes ““02CĐTH019”, “02CĐTH519”, “02TCTH465”,… are grouped into an entity type, named Sinhvien for example.
Similarly, in the student score management application (which will be presented below), we have entity types such as Monhoc, Lop, Khoa, etc. (In this textbook, the name of the entity type is capitalized with the first character, the remaining characters are lowercase).
3.4.Key
A key of an entity type E is an attribute or a set of attributes of E that can be used to distinguish any two entities of E.
For example, the key of the Student entity type is MASV, of the Class is MALOP, of the Faculty is MAKHOA, of the Monhoc is MAMH,...
It should be noted that when representing a system using an entity-associative model, the names of the entity types must be different. In the list of attributes of an entity type, the key attribute set is usually underlined. If a system has many entity types, to simplify the model, one can only name the entity types; the attributes of the entity type are listed separately.

Example 1.1:
The problem of managing student scores is roughly stated as follows: Each
Students need to manage information such as: full name (HOTENSV), date of birth (NGAYSINH), gender (NU), place of birth (NƠISINH), permanent residence (TINH). Each student is given a unique student code (MASV) to distinguish them from all other students of the school, each student belongs to only one class. Each class has a unique class code (MALOP) to distinguish them from all other classes in the school: there is a name (TENLOP) of the class, each class belongs to only one faculty. Each faculty has a name (TENKHOA) and a unique code (MAKHOA) to distinguish them from other faculties. Each subject has a specific name (TENMH), is studied in a number of units (DONVIHT) and corresponding to the subject is a unique code (MAMH) to distinguish it from other subjects. Each lecturer needs to manage the following information: full name (HOTENGV), academic degree (HOCVI), belongs to a major (CHUYENNGANH) and is assigned a unique code called the lecturer code (MAGV) to distinguish it from other lecturers. Each lecturer can teach many subjects in many faculties, but is only under the administrative management of one faculty. Each student with a subject is allowed to take the exam a maximum of 3 times, each time taking the exam (LANTHI), the exam score (DIEMTHI). Each subject in each class is only assigned to one lecturer (of course, a lecturer can teach many subjects in one class).
With the above problem, the types of entities that need to be managed are: Students, Subjects, Faculty, Classes, Lecturers.
For example, with the Student entity type, it is necessary to manage attributes such as: MASV, HOTENSV, NGAYSINH,... and we can represent it as follows:

3.5. Relationship
Associations describe the relationships between entity types in a computer application.
For example, the association between two entity types Student and Class, the association between Student and Subject,...
An association is represented by an ellipse and on either side are two branches associated with the related entity types (or associations), the association name is usually: belongs to, includes, contains,...

For example, between two entity types Class and Faculty there is a "belongs" association as follows:
The number of the combination:
The cardinality of a branch R in a relationship represents the number of entities belonging to the entity on the “other” branch that are related to an entity of branch R.
Each cardinality is a pair of numbers (min,max), indicating the minimum and maximum number of entities participating in that association.

For example:
Meaning: "each student belongs to one and only one class so the branch number
Students are (1,1), each class has 1 to n students so the cardinality on the Lop branch is (1,n)”. In some special cases, the association can have accompanying attributes and therefore they are often named with a more complete meaning.
For example, between the two entity types Monhoc and Sinhvien, there is a ketqua association with the meaning: "each student corresponding to each exam of each subject has a result".

the only test score".
Key of the association: is the union of the keys of related entity types. For example, attribute MAGV is the key of the Giangvien entity type, MALOP is the key attribute of the Lop entity type, MAMH is the key attribute of the Monhoc entity type, so the association phancong (between the entity types Giangvien, Lop, Monhoc) has the key {MAGV, MAMH, MALOP} - phancong is a ternary association.
(In this textbook, the name of the association is written in all lowercase letters.) Establishing an entity relationship model for a computer application can be done in the following steps:
b1. Identify the list of entity types
b2. Identify the associations between entity types to sketch the model.
b3. Make a table of the combinations.
To conclude this chapter, we will model the combined entity for the student score management problem presented in Example 1.1.





