Database
Database
1
At physical level these records can be described as blocks of storage (bytes,
gigabytes, terabytes etc.) in memory. These details are often hidden from the
programmers.
At the logical level these records can be described as fields and attributes
along with their data types, their relationship among each other can be
logically implemented. The programmers generally work at this level because
they are aware of such things about database systems.
At view level, user just interact with system with the help of GUI and enter the
details at the screen, they are not aware of how the data is stored and what
data is stored; such details are hidden from them.
GUI: Graphical User Interface
DBMS Methodology
A structured approach that uses procedures, techniques, tools, and
documentation help to support and make possible the process of design is
called Design Methodology.
A design methodology encapsulates various phases, each containing some
stages, which guide the designer in the techniques suitable at each stage of the
project.
A design methodology also helps the designer to plan, manage, control, and
evaluate database development and managing projects.
Furthermore, it is a planned approach for analyzing and modeling a group of
requirements for a database in a standardized and ordered manner.
The methodology is depicted in three main phases of database design,
namely: conceptual, logical, and physical design. The primary aim of each
phase is as follows:
Conceptual database design: to build the conceptual representation of the
database that has the identification of the important entities, relationships,
and attributes.
Logical database design: to convert the conceptual representation to the
logical structure of the database that includes designing the relations.
Physical database design: to decide how the logical structure is to be
physically implemented (as base relations) in the target Database Management
System (DBMS).
2
. CONCEPTUAL MODEL OF DATA (CMD)
1. Concepts
1.1. Object
An object is an entity which exists inside the studying information system and
which has an interest for the system to be designed.
An object should have fields which characterize it.
Representation
Example
1.2. Field
A field or article or attribute is a propriety which characterizes an object.
Representation
Example
3
Note: When you are naming your fields you should:
Give short and simple names
Give explicit names
Avoid dash (-), if yes use underscore ( _ )
1.3. Identifier
An identifier is a specific field which enables to identify an object’s occurrence
individually.
An identifier should always be underlined.
Examples
4
We differentiate Man Name and Woman Name to avoid the confusion during
programming
1.6. Cardinalities
The minimum cardinality which is the minimum number of times that an
occurrence participates in a relationship.
The maximum cardinality which is the maximum number of times that an
occurrence participates in a relationship.
Example
2. Management Rule
A management rule is a functional constraint in the studying Information
System.
2.1. Examples of management rules
A student cannot take more than 18 credits during one semester at AUCA
Student who paid his school fees in one time must have a reduction of 3%
on his payment
5
Management rules can even be simple things: « Students are not allowed to use
this WC »
II. LOGICAL MODEL OF DATA (LMD)
The LMD is the database architecture. It is obtained using the CMD. It is the
LMD which is implemented to have the database.
1. Concepts
1.1. Table
In the LMD, the object of the CMD always becomes a table and the relationship
can also become a table in certain cases.
In the LMD, the identifier of the CMD always becomes a primary key
CMD
6
2. Translation of CMD to LMD
2.1. Case of Parent-Child Relationship
In this case, the child table inherits the primary key of the parent table to
become its foreign key.
NB: We are driven by the cardinalities:
(1, 1) in parent side
(1,n) in child side
Solution
This is the LMD :
Remember that :
The primary key is always underlined
The foreign key is always underlined using dashes followed by #
7
A child table can have several foreign keys
2.2. Case of Parent-Parent Relationship
In this case, the tables remain with their fields, but the relationship becomes a
table which will get the primary keys of tables as its primary key: It is a
concatenated primary key.
Ex: Translate the following CMD to LMD:
The cardinality in CLIENTS side has changed: Several Clients can indeed
command many Cars.
Solution
This is the LMD:
9
10