Documente Academic
Documente Profesional
Documente Cultură
WEEK 1-2
DATA MODEL
Data modeling, the first step in designing a database, refers to the process of
creating a specific data model for a determined problem.
A data model is a relatively simple representation, usually graphical, of more
complex real-world data structures.
main function : to help understand the complexities of the real-world environment
and to represent data and to make the data understandable. If it does this, then it
can be easily used to design a database
provide the basic concepts and notations that will allow database designers and
end-users accurately to communicate their understanding of the organizational
data.
DATA MODEL
HIERARCHICAL MODEL
was developed in the 1960s to manage large amounts of data for complex
manufacturing projects such as the Apollo rocket that landed on the moon in 1969.
Characteristics :
logical structure is represented by an upside-down tree.
The hierarchical structure contains levels, or segments. A segment is the equivalent of
a file systems record type. Within the hierarchy, a higher layer is perceived as the
parent of the segment directly beneath it, which is called the child.
structure implies that a record can have repeating information, generally in the child data
segments
The hierarchical model depicts a set of one-to-many (1:M) relationships between a
parent and its children segments. (Each parent can have many children, but each child
has only one parent.)
HIERARCHICAL MODEL
HIERARCHICAL MODEL
HIERARCHICAL MODEL
Advantages
The model allows easy addition and deletion of new information
Data at the top of the Hierarchy is very fast to access.
. The model relates very well to natural hierarchies such as assembly plants and
employee organization in corporations. It relates well to anything that works through a
one to many relationship.
Disadvantages
It requires data to be repetitively stored in many different entities.
. The database can be very slow when searching for information on the lower entities
Searching for data requires the DBMS to run through the entire model from top to
bottom until the required information is found, making queries very slow.
. Can only model one to many relationships, many to many relationships are not
supported
NETWORK MODEL
represent complex data relationships more effectively than the hierarchical model
and to improve database performance
Some data were more naturally modeled with more than one parent per child. So,
the network model permitted the modeling of many-to-many relationships in data.
Additional info :
The Network Database Model was invented by Charles Bachman in 1969 to
enhance the existing hierarchical database model.
He created this model to increase the flexibility and make it less difficult to
understand. To make this change Bachman developed the Network Database
Model to allow multiple records to be linked to the same owner file creating a manyto-many relationship rather than a one-to-man
NETWORK MODEL
NETWORK MODEL
NETWORK MODEL
Advantages :
Conceptual simplicity: Just like the hierarchical model, the network model IS also
conceptually simple and easy to design.
Capability to handle more relationship types: The network model can handle the one
to- many (l:N) and many to many (N:N) relationships, which is a real help in modeling
the real life situations.
Data Integrity: The network model does not allow a member to exist without an owner.
Thus, a user must first define the owner record and then the member record. This
ensures the data integrity
Disadvantages :
System complexity: The whole of the database structure can become more complex
than ever..
DBMS LANGUAGE
DATA DEFINITION LANGUAGE (DDL)
DATA MANIPULATION LANGUAGE (DML)
DATA INTEGRITY
The accuracy and consistency of stored data, indicated by an absence of any alteration in data between
two updates of a data records.
Integrity is usually expressed in terms of constraints, which are the consistency rules that the database
is not permitted to violate.
Enforcing data integrity ensures the quality of the data in the database.
For example,
if an employee is entered with an employee_id value of 123, the database should not allow another
employee to have an ID with the same value.
If an employee_rating column intended to have values ranging from 1 to 5, the database should not accept
a value of 6. If the table has a dept_id column that stores the department number for the employee, the
database should allow only values that are valid for the department numbers in the company.
DATA INTEGRITY
Data integrity is normally enforced in a database system by a series of integrity constraints or
rules.
Data integrity falls into these categories:
o Entity integrity
-concerns the concept of a primary key.
-Entity integrity is an integrity rule which states that every table must have a
primary key and that the column or columns chosen to be the primary key
should be unique and not null.
o Referential integrity
- concerns the concept of a foreign key.
-The referential integrity rule states that any foreign key value can only be in one of
two states. The usual state of affairs is that the foreign key value refers to a primary
key value of some table in the database.
DATA INTEGRITY