You are on page 1of 13

Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬

Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬


Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

Stages of elaborating the CDM Model (CDM) ‫مراحل إعداد النموذج المفاهيمي للبيانات‬

The elaboration of the CDM model involves ‫( للبيانات‬CDM) ‫يتضمن إعداد النموذج المفاهيمي‬
the following steps: :‫الخطوات التالية‬

1) Identify the management rules (if these are ‫) تحديد قواعد التسييييي (إذا لم يتم منحها لك عن‬1
not given to you); ‫ط يق المستخدمين)؛‬
2) Elaborate of the data dictionary;
‫) إعداد قاموس البيانات؛‬2
3) Identify of the functional dependencies
‫) بين‬FD( ‫) تحييديييد االرتبيياطييات الوظيفييية‬3
(FD) between data;
‫البيانات؛‬
4) Modeling of the MCD model (creation of
MCD ‫) نميية يية النموذج المفيياهيمي للبيييانييات‬4
entities then relationship then adding
‫(إنشاء الكيانات ثم العالقات ثم إضافة الدر ات‬
cardinalities).
.)‫التشاركية‬
Important note: In applied reality, not all of ‫ ليسيييل كذ هة‬،‫ في الواقع التطبيقي‬:‫مالحظة هامة‬
these steps are mandatory, especially preparing the
‫ خاصة إعداد قاموس البيانات وتحديد‬،‫الخطوات إلزامية‬
data dictionary and defining the functional
dependencies, as in many applied cases, creating ‫ كمييا هو الحيياث في ك ي من‬،‫االرتبيياطييات الوظيفييية‬
the conceptual data model precedes preparing the
‫ فيياء إنشييييياء النموذج المفيياهيمي‬،‫الحيياالت التطبيقييية‬
data dictionary and functional dependencies,
because the data is insufficient, and what exists is ‫للبييانيات يسييييبق إعيداد قياموس البييانيات واالرتبياطيات‬

not completely known in the beginning. Even the ‫ نء البييانيات ي كيافيية وميا هو مو ود لي‬،‫الوظيفيية‬
perception of having a comprehensive data
‫ وصتر تصييييور و ود قياموس‬.‫مع وفايا تميا اميا في البيدايية‬
dictionary at the beginning is not realistic in
complex cases. .‫واقعيا في الحاالت المعقدة‬ ‫بيانات شامذ في البداية لي‬

Thus, there is no linear sequence of these ‫وبالتالي ال يو د تسييلسييذ خطي لهة الخطوات بذ‬
steps, but rather a set of repetitions and sometimes ‫ميجيميوعيية مين اليتيكي ارات واليتيخيليي اليتيياض عين بيعي‬
complete abandonment of some steps: :‫الخطوات أصيانا‬

1) Draw a model with the entities and ‫) رسيييم النموذج مع الكيانات والعالقات التي‬1
associations that seem necessary, ،‫تبدو ض ورية‬

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 1


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

2) Evaluate whether what has been designed is ‫) تقييم ما إذا كاء ما تم تصييييميمي صييييحي احا‬2
correct and matches what users understand, ،‫ويتوافق مع ما يفهمي المستخدموء‬
3) Iterate, gradually completing until the form ‫تييدريجيييا صتر ي ه‬
‫ا‬ ‫ واإلكميياث‬،‫) التك ار‬3
appears reasonably complete. ‫ا‬
.‫مكتمال إلر صد معقوث‬ ‫النموذج‬
1. Management Rules ‫ قواعد التسيير‬.1

Before you start creating your database ‫قبذ أء تبدأ في إنشياء داوث قاعدة البيانات الخاصية‬
tables (or even the entities and relationships of ‫بييك (أو صتر الكيييانييات والعالق ية الخيياصييييية بنموذج‬
your Conceptual Data Model (CDM)), you
‫عليييك مع اصتيييا ييات‬ ‫ يج ي‬،)‫المفيياهيمي للبيييانييات‬
should gather the needs of the future users of
‫المسيتخدمين المسيتقبليين لتطبيقك وقاعدة البيانات الم اد‬
your application and the database they want to
use. From these needs, you must be able to ‫قادرا‬
‫ يج أء تكوء ا‬،‫ ومن هة االصتيا ات‬.‫اسيييتعمالها‬
establish the management rules for the data to be ‫علر وضيييع قواعد التسييييي الخاصييية بالبيانات الم اد‬
kept in your Information Systems. .‫االصتفاظ بها‬

Example 01: Let's take the example of a ‫علييي‬ ‫ لنيخخية م ياث المطور اليةب يجي‬:01 ‫مثاا‬
developer who has to computerize a library's IS.
‫ قمنا بوضييع‬.‫صوسييبة ن اض المعلومات الخاب بالمكتبة‬
We have established the following management
rules: :‫قواعد التسيي التالية‬

• Rule 01: For each book, we must know the ‫أء نع ل العنواء‬ ‫ لكيذ كتياي يجي‬:01 ‫• القااعاد‬
title, the year of publication, a summary and
، ‫ شيع‬،‫وسينة النشي والملخو ونوا الكتاي (رواية‬
the book type (novel, poetry, science fiction,
etc.); .)‫ إلخ‬،‫خياث علمي‬

• Rule 02: the book may be written by an ‫الكتياي من قبيذ شييييخو‬ ‫ يمكن تيخلي‬:02 ‫• القااعاد‬
unknown person (in the case of an anonymous
‫واصيد أو‬ ‫ م ل‬،)‫مجهوث (في صيالية العميذ المجهوث‬
work), one or more authors (in which case
their first name, last name, date of birth, and ‫أك (في هية الحيالية يكوء اسييييميي انوث واسييييميي‬

country of origin are known.); ).‫انخي وتاريخ ميالد وبلد انصلي مع وفين‬

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 2


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

• Rule 03: Each copy of a book is identified by ‫كيذ نسييييخية من الكتياي‬ ‫ يتم تع ي‬:03 ‫• القااعاد‬
a reference made up of letters and numbers
‫ وال يتم نش ها إال‬،‫ع مكوء من ص ول وأرقاض‬ ‫بم‬
and can only be published in one and only one
edition; .‫في طبعة واصدة فقط‬

• Rule 04: A registrant (borrower) is ‫المسييجذ (المسااترير) ب قم‬ ‫ يتم تع ي‬:04 ‫• القاعد‬
identified by a number and must memorize his
‫ويج أء يحفظ اسيمي انخي واسيمي انوث وعنواني‬
or her last name, first name, address,
telephone number and e-mail address; ‫ورقم هاتفي وعنواء ب يد اإللكت وني؛‬

• Rule 05: The registrant may borrow one or ‫ يمكن للمسيييجذ أء يسيييتعي نسيييخة أو‬:04 ‫• القاعد‬
more copies, or he may not borrow any copy.
‫ لكذ اسييتعارة يج أء‬، ‫أك كما يمكني أال يسييتعي‬
For each borrowing, we must know the date
and duration granted (number of days). .)‫نع ل التاريخ والمدة الممنوصة (عدد انياض‬

Note: these rules are sometimes given to you, but ،‫انصيياء‬ ‫ هية القواعيد تطعطر ليك في بع‬:‫مالحظاة‬
you may have to establish them yourself in two
:‫ولكن قد يتعين عليك وضعها بنفسك في صالتين‬
cases:
1) You are both project management and ‫) أنل مدي المشييي وا ومالك المشييي وا في‬1
project owner, and you are developing an
‫ وتقوض بتطوي تطبيق نيابة عنك‬،‫الوقل‬ ‫نف‬
application on your behalf and/or
according to your own directives; ‫أو وفقاا لتو يهاتك الخاصة؛‬/‫و‬

2) What happens most often: future users of ‫ ال يتمكن‬:‫انصييياء‬ ‫في أ ليي‬ ‫) مييا يحييد‬2
your project were not able to provide you ‫المسيييتخدموء المسيييتقبليوء لمشي ي وعك من‬
with these rules with sufficient precision; ‫تزوييد بهية القواعيد بيدقية كيافيية؛ ولهيةا‬
this is why you will have to question them ‫السيييب سييييتعين عليك اسيييتجوابهم من أ ذ‬
in order to establish these rules yourself. .‫وضع هة القواعد بنفسك‬

Never forget that as a developer, you have a ‫ من واجبك مساعد‬،‫ال تنس أبدًا أنه كمطور‬
duty to assist the project owner if this proves
.‫صاحب المشروع إذا كان ذلك ضروريًا‬
necessary.

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 3


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

2. Data Dictionary (DD) (DD)‫ قاموس البيانات‬.2

This is an intermediate step which can be ‫ خاصية إذا‬،‫هة خطوة وسييطة يمكن أء تكوء مهمة‬
important, especially if there are several persons ‫قياعيدة‬ ‫كياء هنيا العيدييد من انشييييخياب يعيدوء نف‬
developing on the same database of a large
. ‫البيانات ذات الحجم الكبي‬
volume.

The Data Dictionary (DD) is a document ‫) هو مسييييتنيد يجمع البييانيات‬DD( ‫قياموس البييانيات‬
which brings together all the data that you will
‫التي سيييييتعين علييك االصتفياظ بهيا في قياعيدة البييانيات‬
have to keep in your database (and which will
therefore appear in the MCD). .)MCD ‫(والتي ست ه بالتالي في نموذج‬

For each data, it indicates: :‫ويشار لكذ خاصية من البيانات بالتالي‬

❖ Mnemonic code: this is a label designating a ‫ عبارة عن ملصييق يحدد ز اءا من‬:‫❖ رمز ذاكري‬
piece of data (for example “Title_Book” for Title_Book ‫البييانات (علر سييييبييذ الم ياث‬
the title of a book); ‫لعنواء الكتاي)؛‬
❖ Designation: this is a statement describing ‫ما يتوافق مع البيانات‬ ‫ هةا عبارة تص‬:‫❖ التريين‬
what the data corresponds to (for example ‫(علر سبيذ الم اث عنواء الكتاي )؛‬
“title of the book”);
❖ Data type: is an attribute associated with a ‫ هي خياصيييييية ت تبط بيالبييانيات‬:‫❖ نوع البيااناات‬
data that tells a computer system how to ‫ يمكن‬.‫تخب ن اض الكمبيوت بكيفية تفسيي قيمتها‬
interpret its value. The data type can be: :‫أء يكوء نوا البيانات‬
1) Alphabetical (A): when the data is only ‫ عندما تتكوء البيانات فقط من‬:)A( ‫) جملي‬1
composed of alphabetical characters ‫ إلر‬A ‫ ومن‬Z ‫ إلر‬A ‫أص ل (من‬
(from 'A' to 'Z' and from 'a' to 'z' ، )‫ تشمذ أص ل ال موز‬Z
including symbols characters),
2) Numeric (N): when the data is composed ‫ عندما تتكوء البيانات فقط من‬:)N( ‫) رقمي‬2
only of numbers (integer or real), ، )‫انرقاض (عدد صحيح أو صقيقي‬

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 4


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

3) Alphanumeric (AN): when the data can ‫ عندما يمكن أء تتكوء‬:)AN( ‫) األبجدية الرقمية‬3
be composed of both alphabetical and ،‫البيانات من كذ من الشخصيات انبجدية وال قمية‬
numeric characters,

4) Date: when the data is a date (in YYYY- yyyy- ‫ عندما تكوء البيانات تاري اخا (بتنسيق‬:‫) تاريخ‬4
MM-DD format), ، )mm-dd

5) Boolean (Bool): True or False (1 or 0). .)0 ‫ أو‬1( ‫ صحيح أو خطخ‬: (Bool)‫) منطقي‬5

❖ Size: it is expressed in number of characters .‫ ويعب عنيي بعيدد الح ول أو انرقياض‬:‫❖ الحجم‬
or numbers. In the case of a date in the format YYYY-DD- ‫في صالة و ود تاريخ بالتنسييق‬
YYYY-DD-MM, we also count the number 10 ‫ أب‬،‫كييذ انص ل‬ ‫ فيياننييا نحسييييي‬،MM
of characters, i.e., 10 characters. As for the ‫ فال داعي‬،‫ أميا بيالنسييييبية للنوا المنطقي‬.‫أص ل‬
Boolean type, there is no need to specify the
DBMS ‫لتحيدييد الحجم (يعتميد هيةا علر تطبيق‬
size (this depends on the DBMS
‫المستعمذ)؛‬
implementation);
❖ Observations: Sometimes additional ‫انصيييياء ميالصي ييات‬ ‫ فيي بيعي‬:‫❖ الاماالحاظااات‬
remarks or observations (for example if a ‫ إذا كانل إصد‬،‫إضييييافية (علر سييييبيذ الم اث‬
piece of data is strictly greater than 0, etc.). .)‫ وما إلر ذلك‬،0 ‫البيانات أكب من‬
Let's take the example of our library and the
‫لنخخة م اث مكتبتنا ون اض إدارة االسيتعارة الةب نحن‬
borrowing management system that we are
responsible for computerizing. After studying the ‫ بعد دراسيية قواعد التسيييي في‬.‫مسي ولوء عن صوسييبتي‬
management rules in (example 01), we can establish
:‫) التالي‬DD( ‫) يمكننا إنشاء قاموس البيانات‬01 ‫(م اث‬
the following data dictionary:

Mnemonic code Designation Type Size Observations


Id_Reg Numerical identifier of a registrant N
(Borrower)
() ‫)رقم تع يفي للمسجذ(المستعي‬
F_Name_Reg First name of registrant A 30
(‫)اسم المسجذ‬
L_Name_Reg Last name of registrant A 30
(‫)لق المسجذ‬
Street _Reg Street where a registrant lives AN 50
(‫)الشارا الةب يعيش فيي المسجذ‬
City_Reg City where a registrant lives A 50
(‫)المدينة التي يعيش فيها المسجذ‬

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 5


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

P_Code_Reg Postal code of a registrant AN 5


()‫ال مز الب يدب للمسجذ‬
Tel_Reg Telephone number of a registrant AN 15
(‫)هات المسجذ‬
Email_Reg Email address of a registrant AN 100
(‫)الب يد اإللكت وني للمسجذ‬
Date_Birth_Reg Date of birth of a registrant Date 10 In YYYY-DD-MM format
(‫)تاريخ مالد المسجذ‬
Id_Book Numerical identifier of a book N
(‫)رقم مع ل للكتاي‬
Title_Book Title of a book AN 50
(‫)عنواء الكتاي‬
Year_ Book Year of publication of a book N 4
(‫)سنة طباعة الكتاي‬
Summary_ Book Summary of a book AN 1000
(‫)ملخو الكتاي‬
Ref_Copy_book Reference code of a copy of a book AN 15 This reference will also
(‫)رقم تع يفي لنسخة من الكتاي‬ serve as an identifier in this
system.
Id_Type_Book Numeric identifier of a book type N
(‫)رقم مع ل لنوا الكتاي‬
Lab_ Type_Book Label of a book type AN 30
(‫)نوا الكتاي‬
Id_Edition Numerical identifier of a book edition N 6
(‫)رقم مع ل للطبعة الكتاي‬
Name_ Edition Name of a book edition AN 30
(‫)إسم الطبعة‬
Id_Author Numeric identifier of an author N
( ‫)رقم مع ل للكات‬
F_Name_ Author Name of an author A 30
( ‫)إسم الكات‬
L_Name_Author First name of an author A 30
( ‫)لق الكات‬
Date_Birth_Author Date of birth of an author Date In YYYY-DD-MM format
( ‫)تاريخ مالد الكات‬
Id_Country Numerical identifier of a country N
(‫)رقم مع ل للبلد‬
Name_ Country Name of a country A 50
(‫)إسم البلد‬
Id_Loan Numerical identifier of a loan N
(‫)رقم مع ل لإلستعارة الكتاي‬
Date_ Loan Loan date Date In YYYY-DD-MM format
(‫)تاريخ اإلستعارة‬
Deadline _ Loan Deadline allowed when borrowing N 3 Expressed in number of
the book days
(‫)عدد إياض اإلستعارة‬

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 6


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

Note: the data that appears in the MCD (and ‫ (وبالتالي في‬MCD ‫ البيانات التي ت ه في‬:‫ملحوظة‬
therefore in the data dictionary) must be, in most :‫قاموس البيانات) يج أء تكوء أولية في مع م الحاالت‬
cases, elementary:

❖ They must not be calculated: the calculated ‫ يج الحصيوث علر البيانات‬:‫❖ يجب أال يتم حسااباا‬
data must be obtained, by calculation, from ‫ من البييانيات‬،‫ عن ط يق الحسييييياي‬،‫المحسييييوبية‬
elementary data which is kept in the database. ،‫ ومع ذليك‬.‫انوليية المحفوظية في قياعيدة البييانيات‬
However, there are some cases where it is ‫الحاالت التي يكوء فيها من المناسييي‬ ‫هنا بع‬
relevant to keep, for optimization reasons,
،‫ بالبيانات المحسييوبة‬،‫ نسييباي التحسييين‬،‫االصتفاظ‬
calculated data, the amount of an order for
.‫م ذ مبلغ الطل علر سبيذ الم اث‬
example.
❖ They must not be composed: the composed ‫ يج الحصوث علر البيانات‬:‫❖ يجب أال تكون مكونة‬
data must be obtained by the concatenation ‫المكونية عن ط يق مع البييانيات انوليية المخزنية‬
of elementary data stored in the database. For
‫ يتم الحصيوث‬،‫ علر سيبيذ الم اث‬.‫في قاعدة البيانات‬
example, an address is obtained from a street,
‫ يتم‬:‫علر عنواء من شيييييارا وبليدة ورمز ب ييدب‬
a town and a postal code: it is these last three
data which are kept and therefore which will ‫االصتفياظ بهية البييانيات ال الثية انخي ة وبيالتيالي‬
appear in the MCD and in the data dictionary. .‫ وفي قاموس البيانات‬MCD ‫ست ه في‬

3. Functional dependencies (FD) (DF) ‫ االرتباطات الوظيفية‬.3

Consider the two properties (or data) P1 and


‫نقوث‬P2 ‫ و‬P1 )‫خة بعين االعتبار الخاصييتين (أو البيانات‬
P2. We say that P1 and P2 are linked by a
functional dependence (FD) if and only if an ‫( إذا وفقط إذا كيانيل مع فية‬FD) ‫م تبطياء وظيف يا‬P2 ‫ و‬P1 ‫إء‬

occurrence (or value) of P1 makes it possible to . P2‫ تجعذ من الممكن مع فة قيمة واصد فقط لي‬P1 ‫قيمة‬
know one and only one occurrence of P2.

This dependency is represented like this: :‫يتم تم يذ هة االرتباط علر النحو التالي‬

P1 → P2

We say that P1 is the source of the FD and that P2 .‫ هو الادف‬P2 ‫ وأء‬FD ‫ هو مصدر‬P1 ‫نقوث إء‬
is the goal.

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 7


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

Furthermore, several data can be the source just as ‫ يمكن أء تكوء العديد من البيانات هي المصييدر‬،‫عالوة علر ذلك‬
several data can be the goal of a DF. .DF ‫كما يمكن أء تكوء العديد من البيانات هي هدل‬
Examples: :‫أمثلة‬

P1, P2→P3

P1→ P2, P3

P1, P2→ P3, P4, P5

By taking the data from the previous ‫ يمكننا إنشيييياء‬،‫من خالث أخة البيانات من القاموس السييييابق‬
dictionary, we can establish the following FDs. .‫ التالية‬FDs

Id_Loan → Date_ Loan, Deadline _ Loan, Id_Reg, Ref_Copy_book

Id_Ref → F_Name_Reg, L_Name_Reg, Street_ Reg, City_ Reg, P_Code_i, Tel_ Reg,

Email_ Reg, Date_Birth_ Reg

Ref_Copy_book → Id_Book

Id_Book → Title_Book, Year_Book, Symmary_Book, Id_Type_Book, Id_Ed

Id_Type_Book → Lab_Type_Book

Id_Edition → Name_Edition

Id_Author → F_Name_Author, L_Name_ Author, Date_Birth_Author, Id_Country

Id_Country → Name_Country

The following conclusions can be deduced from these ‫يمكن اسييييتخالب االسييييتنتييا ييات التييالييية من هيية‬
FDs:
:FDs ‫االرتباطات الوظيفية‬

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 8


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

❖ From a borrowing number, we obtain a ،‫❖ من رقم االستعارة نحصذ علر تاريخ االستعارة‬
borrowing date, a deadline, the identifier of
‫ ومع ل المسجذ الةب قاض‬،‫والموعد النهائي‬
the registrant who made the borrowing, the
reference of the borrowed copy; ‫ع النسخة المستعارة؛‬ ‫ وم‬، ‫بالمستعي‬

❖ From a copy reference, we obtain the ‫ نحصذ علر مع ل الكتاي‬،‫ع النسخة‬ ‫❖ ومن م‬
identifier of the corresponding book;
‫المقابذ؛‬

❖ From a book number, we obtain its title, its ‫❖ ومن رقم الكتاي نحصذ علر عنواني وسنة نش‬
year of publication, a summary, the
identifier of the corresponding type, its ‫وملخصي ومع ل النوا المقابذ لي ورقم طبعتي؛‬
edition number;
4. Establish the CDM model CDM ‫ إنشاء نموذج‬.4

1) Identify the entities ‫) تحديد الكيانات‬1

If we take our previous data dictionary, we ‫ فاننا نسييتطيع وضييع‬،‫إذا أخةنا قاموس البيانات السييابق‬
schematize for example an “Author” entity like
:‫كالتالي‬ Author ‫تصميم علر سبيذ الم اث لكياء‬
this:

Figure 1: The author entity

❖ From this entity, we can find the ‫❖ من هيةا الكيياء يمكننيا أء نسييييتخلو قياعيدة‬
following management rule: an
‫ب قم‬ ‫الم ل‬ ‫ يتم تع ي‬:‫التسيييييي التييالييية‬
author is identified by a unique
number (Id_Author) and is ‫(وعييينيييد االسيييييييم انوث‬Id_Author)
characterized by a last name ‫ واالسييييم انخييي‬،(F_Name_Author)
(F_Name_Author), first name
‫(وتييارييخ اليميييالد‬L_Name_Author)
(L_Name_Author) and date of birth
(Date_Birth_Author). (Date_Birth_Author).

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 9


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

❖ An entity can have zero, one or ‫❖ يمكن أء يحتوب الكيياء علر صييييف أو قيمية‬
more occurrences. To illustrate
‫ لتوضيييييح هيةا المصييييطلح‬. ‫واصيدة أو أك‬
this term “occurrence” or
“instance” or “value” which has ‫الم يذ أو القيمة الةب تم استخدامي بالفعذ‬
already been used several times,
‫ فيمييا يلي م يياث لجييدوث التم يييذ‬،‫عيدة م ات‬
here is an example of an
occurrence table for the Author : ‫لكياء الم ل‬
entity:
Note: At the conceptual level, we should rather ‫ ينبغي لنا أء نتحد‬،‫ علر المستو المفاهيمي‬:‫مالحظة‬
speak of entity-types, the entities being in fact
‫ والكييانيات هي في الواقع أم لية علر‬،‫عن أنواا الكييانيات‬
instances of entity-types. For simplifying, we will
‫ سينحتفظ بمصيطلحات الكيانات‬،‫ للتبسييط‬.‫أنواا الكيانات‬
retain the terms entities and associations
throughout the course. .‫والجمعيات طواث الدورة التدريبية‬

Id_Author F_Name_Author L_Name_Author Date_Birth_Author


1 Sami Mahfoud 1802-02-26
2 Amina Hanid 1854-10-20
3 Sihem Azi 1850-08-05
4 Wissam Mehibel 1954-11-01

This table is composed of four instances of the ‫يتيكيوء هييةا اليجييدوث مين أربيع تيمي يييالت (قيييم) ليكيييياء‬
Author entity.
. ‫الم ل‬

2) Identify the Relationships and ‫) تحديد الرالقات والدرجات المشاركة‬2


Cardinalities
❖ A Relationship defines a semantic link ‫❖ تحيدد العالقية ال ابط اليداللي بين كيياء واصيد أو‬
between one or more entities. Indeed, the
‫ فاء تحديد ال وابط بين الكيانات‬،‫ وفي الواقع‬. ‫أك‬
definition of links between entities makes it
possible to translate part of the management ‫مة زء من قواعد التسيييي‬ ‫يجعذ من الممكن ت‬
rules which were not satisfied by the simple
.‫البسيط للكيانات‬ ‫التي لم يستوفها التع ي‬
definition of the entities.

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 10


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

❖ Generally, the name of the relationship is a ‫ إء اسيم العالقة هو فعذ يحدد االرتباط‬،‫❖ بشيكذ عاض‬
verb defining the link between the entities ‫ علر‬.‫بين الكييانيات التي ت تبط بهيا هية انخي ة‬
which are linked by the latter. For example:
:‫سبيذ الم اث‬

Figure2 : the relationship Was_Born

Here, the relationship (association) “Was_born” ‫“ بقياعيدتي‬Was_born” )‫م عالقية (ارتبياط‬ ‫وهنيا يمكن ت‬
translates the following two management rules: :‫التسيي التاليتين‬

• An author was born in one and only one ،‫في بلد واصد فقط‬ ‫• ولد الم ل‬
country;
‫أو ولد‬ ‫ يمكن أني لم يولد فيي أب م ل‬،‫• في بلد ما‬
• In a country, none, one or more authors
were born. . ‫واصد أو أك‬ ‫م ل‬

You will notice that this association is characterized by ‫سيييتالصظ أء هةا االرتباط يتميز بهة التعليقات التوضييييحية‬
these annotations 1-1 and 0-N which allowed us to
.‫ والتي سيييمحل لنا بتحديد قواعد التسييييي السيييابقة‬N-0‫ و‬1-1
define the previous management rules. These
.‫تسمر هة التعليقات التوضيحية بالعناص انساسية‬
annotations are called cardinalities.

3) Elaborate the final model ‫) وضع النموذج الناائي‬3

With all of this knowledge, rules ‫ قواعد التسيييي واالرتباطات‬،‫مع كذ هة المعطيات‬


management and FDs, we must identify all
‫علينييا تحييديييد ميع الكيييانييات‬ ‫ يج ي‬،FDs ‫الوظيفي ية‬
entities and associations possible. So, it is
‫ من الممكن لنيا إعيداد نموذج‬،‫ ليةليك‬.‫والعالقيات الممكنية‬
therefore possible for us to develop the
complete MCD from the data present in the ‫ النهييائي من البيييانييات المو ودة في قيياموس‬MCD
data dictionary, as shown in Figure 3. .3 ‫ كما هو موضح في الشكذ‬،‫البيانات‬

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 11


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

Figure 3: The CDM model of sales management of the previous example.

Notes :
❖ Often, for the same set of management rules, ‫ هنا‬، ‫مجموعة قواعد التسيي‬ ‫ لنف‬،‫❖ في ك ي من انصياء‬
several solutions are possible at the conceptual
.‫العديد من الحلوث الممكنة علر المستو المفاهيمي‬
level.
❖ For the MCD to be semantically valid, any ‫ يج أء ي تبط أب كياء‬،‫ صحيحا بنائيا‬MCD ‫❖ لكي يكوء‬
entity must be linked to at least one
.‫بعالقة واصدة علر انقذ‬
association.

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 12


Topic 02: Relational database design ‫ تصميم قواعد البيانات العالئقية‬:02 ‫المحور‬ 04 ‫اعالم الي‬
Lesson 02: Conceptual Data Model ‫ نموذج المفاهيمي للبيانات‬:02 ‫الدرس‬
Third year-23/24
(CDM)-Part 02 02 ‫الجزء‬-(CDM) Computer Science 04

❖ There are paid and free modeling tools for ‫ م ذ‬MERISE ‫❖ تو د أدوات نمة ة مدفوعة ومجانية ل ي‬
MERISE as powerAMC, OpenModelSphere, AnalyseSI‫ و‬OpenModelSphere‫و‬powerAMC
AnalyseSI, JMerise, etc. .‫إلخ‬..JMerise‫و‬
Once the CDM is complete, it can be used to ‫ يمكيييييين‬،CDM ‫بمجيييييي د إكميييييياث نمييييييوذج‬
create the logical data model (LDM) and then ‫اسيييييتخدامي إلنشييييياء نميييييوذج المنطقيييييي للبيانيييييات‬
physical data model (PDM). The LDM model is .)PDM( ‫) ثييييم نمييييوذج المييييادب للبيانييييات‬LDM(
a more detailed representation of the data, and the ،‫ هييو تم يييذ أك يي تفصيييالا للبيانييات‬LDM ‫النمييوذج‬
PDM is a representation of the data that is
‫ هيييو تم ييييذ للبيانيييات خييياب بن ييياض‬PDM ‫ونميييوذج‬
specific to the database management system that
‫ فيييي‬.‫إدارة قاعيييدة البيانيييات اليييةب سييييتم اسيييتخدامي‬
will be used. In the next lesson, we will discuss
‫ ساااوف نااادرس نماااوذج البياناااات‬،‫اليييدرس التيييالي‬
the Logical Data Model (LDM) in detail.
.‫) بالتفصيل‬LDM( ‫المنطقي‬

‫محفوظ سامي‬/‫د‬-‫ حاند أمينة‬/‫د‬ 13

You might also like