Chapterبەش 3 · Lectureوانە 3.2
Entity-Relationship Modellingمۆدێلی قەوارە و پەیوەندی
Designing a database on paper with the E-R model: entities, the kinds of attribute and how each is drawn, key attributes, relationships and their cardinality (1:1, 1:N, M:N), weak entities and participation, and how to read an E-R diagram – with university and clinic examples.
دیزاینکردنی لەسەر کاغەز بە : ، جۆرەکانی و چۆنیەتی کێشانی هەر یەکێکیان، ، و (1:1، 1:N، M:N)، و بەشداری و خوێندنەوەی – بە نموونەی زانکۆ و نۆرینگە.
What you will learnچی فێر دەبیت
- Explain what the E-R model is for and name its goals and building blocks.
- Tell entities from entity sets, and classify attributes as simple or composite, single- or multi-valued, stored or derived.
- Draw and read relationships with their cardinality (1:1, 1:N, M:N), and explain why M:N needs a junction table.
- Draw weak entities, identifying relationships, partial keys and total or partial participation.
- Tell an E-R diagram from a database diagram and draw a complete E-R diagram for a small organisation.
- ڕوونی بکەیتەوە بۆ چییە و ناوی ئامانج و بەردە بناغەکانی بهێنیت.
- لە جیا بکەیتەوە و پۆلێن بکەیت: سادە یان لێکدراو، تاکنرخ یان فرەنرخ، هەڵگیراو یان داتاشراو.
- لەگەڵ (
1:1،1:N،M:N) بکێشیت و بیخوێنیتەوە و ڕوونی بکەیتەوە بۆچیM:Nپێویستی بە هەیە. - ، ، و یان بکێشیت.
- لە هێڵکاریی جیا بکەیتەوە و تەواو بۆ دامەزراوەیەکی بچووک بکێشیت.
What the E-R model isمۆدێلی قەوارە و پەیوەندی چییە
A that describes the real world as , their and the between them. It is drawn as an .
کە جیهانی ڕاستەقینە وەک وەسف دەکات، لەگەڵ و نێوانیان. وەک دەکێشرێت.
The Entity-Relationship (E-R) model is a popular conceptual data model – the kind of model that says what is stored, not how (see Data models). It is used in the design of database applications. It describes the data to be stored and the constraints over the data: the rules the data must obey, such as “every visit belongs to exactly one patient”.
باوە – ئەو جۆرە مۆدێلەی دەڵێت چی هەڵدەگیرێت، نەک چۆن (مۆدێلەکانی دراوە ببینە). لە دیزاینکردنی بەکار دێت. ئەو دەبێت هەڵبگیرێت وەسف دەکات، لەگەڵ کە بەسەر دەسەپێنرێن: ئەو یاسایانەی دەبێت پەیڕەویان بکات، وەک «هەموو سەردانێک ڕێک سەر بە یەک نەخۆشە».
The E-R model views the real world as a collection of entities (the things we want to remember) and relationships among those entities. It is a graphical model: it is drawn as a picture called an E-R diagram, which shows the entities and the relationships between them.
جیهانی ڕاستەقینە وەک کۆمەڵێک (ئەو شتانەی دەمانەوێت لە بیرمان بمێنن) و نێوانیان دەبینێت. مۆدێلێکی وێنەییە: وەک وێنەیەک دەکێشرێت کە پێی دەوترێت و و نێوانیان پیشان دەدات.
Peter Chen published the E-R model in 1976 (ACM Transactions on Database Systems). It is a semantic model: it records what the data means, not only the values.
Peter Chen لە ساڵی 1976 بڵاو کردەوە (ACM Transactions on Database Systems). مۆدێلێکی واتاییە: ئەوە تۆمار دەکات کە واتای چییە، نەک تەنها نرخەکان.
Before builders in Erbil start a new house, an engineer draws its plan: which rooms there are, what each room is for and which doors join them. The family can look at the plan, say “the kitchen is too far from the dining room”, and the drawing is changed in minutes. An E-R diagram is the plan of a database: the rooms are the entities, the doors are the relationships.
پێش ئەوەی وەستاکان لە هەولێر دەست بە دروستکردنی خانوویەکی نوێ بکەن، ئەندازیارێک نەخشەکەی دەکێشێت: چ ژوورێک هەیە، هەر ژوورێک بۆ چییە و کام دەرگا بەیەکەوەیان دەبەستێتەوە. خێزانەکە دەتوانێت سەیری نەخشەکە بکات و بڵێت «چێشتخانەکە زۆر دوورە لە ژووری نانخواردن» و وێنەکە لە چەند خولەکێکدا دەگۆڕدرێت. نەخشەی : ژوورەکان و دەرگاکان .
Where the analogy stops workingسنووری ئەم نموونەیە
A house plan also shows sizes and the pipes inside the walls. An E-R diagram does not show how the data will be stored on the disk or which DBMS will be used; those decisions come later.
نەخشەی خانوو قەبارە و بۆرییەکانی ناو دیوارەکانیش پیشان دەدات. پیشان نادات چۆن لەسەر دیسک هەڵدەگیرێت یان کام بەکار دەهێنرێت؛ ئەو بڕیارانە دواتر دێن.
Goals of E-R modellingئامانجەکانی مۆدێلی قەوارە و پەیوەندی
A good E-R model achieves four things:
باش چوار شت بەدی دەهێنێت:
- It captures all the required information. Nothing the business needs is left out of the design.
- Each piece of information appears only once. Every fact is stored in exactly one place, so it cannot disagree with itself.
- It prevents mistakes and misunderstanding. A drawing that everyone can see leaves less room for guessing.
- It helps discussion about the information needs of the business. Technical and non-technical people get one picture to talk about.
- هەموو ئەو پێویستە دەگرێتەوە. هیچ شتێک کە دامەزراوەکە پێویستی پێیەتی لە دیزاینەکەدا ون نابێت.
- هەر تەنها یەکجار دەردەکەوێت. هەر ڕاستییەک ڕێک لە یەک شوێندا هەڵدەگیرێت، بۆیە ناتوانێت لەگەڵ خۆیدا ناکۆک بێت.
- ڕێگە لە هەڵە و تێنەگەیشتن دەگرێت. وێنەیەک کە هەمووان دەیبینن جێگەی کەمتر بۆ مەزەندە دەهێڵێتەوە.
- یارمەتیی گفتوگۆ دەدات دەربارەی پێداویستییەکانی لە دامەزراوەکەدا. کەسانی تەکنیکی و ناتەکنیکی یەک وێنەیان دەبێت بۆ قسەکردن لەسەری.
The four building blocksچوار بەردە بناغەکە
Every E-R model is made of four building blocks:
لە چوار بەردە بناغە پێکدێت:
- Entities – the things you store information about.
- Attributes – the facts that describe each thing.
- Identifier – the attribute that tells one thing from another.
- Relationships – the links between the things.
- – ئەو شتانەی دەربارەیان هەڵدەگریت.
- – ئەو ڕاستییانەی هەر شتێک وەسف دەکەن.
- ناسێنەر () – ئەو شتێک لە شتێکی تر جیا دەکاتەوە.
- – بەستنەوەکانی نێوان شتەکان.
The next screens take them one by one: entities, then the kinds of attribute, then identifiers, then relationships. After that come weak entities, which need the other three to be understood.
شاشەکانی داهاتوو یەک بە یەک باسیان دەکەن: سەرەتا ، پاشان جۆرەکانی ، پاشان ناسێنەرەکان و دواتر . لە دوای ئەوانەش دێن، کە بۆ تێگەیشتنیان پێویستت بە سێکەی ترە.
Explains in Kurdish the four building blocks of an E-R model: entity, attribute, primary key (identifier) and relationship.
بە کوردی چوار بەشە بنەڕەتییەکەی ڕوون دەکاتەوە: ، ، (کە هەر جیا دەکاتەوە) و .
Kurdish explanation of entity, attribute, primary key and relationship: the four building blocks.
ڕوونکردنەوەی کوردیی ، ، و : چوار بەشە بنەڕەتییەکە.
Entitiesقەوارەکان
A thing in the real world that we want to store information about, such as a person, a place, an object or an event. In an it is drawn as a rectangle.
شتێکە لە جیهانی ڕاستەقینەدا کە دەمانەوێت زانیاری دەربارەی هەڵبگرین، وەک کەسێک، شوێنێک، کەلوپەلێک یان ڕووداوێک. لە وەک لاکێشە دەکێشرێت.
An entity is any object in the system that we want to store information about – a person, a company, an event and so on. Examples: Student, Teacher, Course, Employee, Department – anything the organisation keeps records about.
هەر شتێکە لە سیستەمەکەدا کە دەمانەوێت دەربارەی هەڵبگرین – کەسێک، کۆمپانیایەک، ڕووداوێک و هتد. نموونە: قوتابی، مامۆستا، وانە، فەرمانبەر، بەش – هەر شتێک کە دامەزراوەکە بۆ ڕادەگرێت.
Entities are drawn as rectangles, with round or square corners. An entity is described by a set of attributes; for example, people have names and addresses.
وەک لاکێشە دەکێشرێن، بە گۆشەی خڕ یان چوارگۆشە. بە کۆمەڵێک وەسف دەکرێت؛ بۆ نموونە، خەڵک ناو و ناونیشانیان هەیە.
Entitiesقەوارەکان
Where entities come fromقەوارەکان لە کوێوە دێن
When you read the description of an organisation, its entities hide in six kinds of noun:
کاتێک وەسفی دامەزراوەیەک دەخوێنیتەوە، لە شەش جۆر ناودا خۆیان شاردووەتەوە:
| Kindجۆر | Examplesنموونە |
|---|---|
| Peopleخەڵک | students, lecturers, customers, patientsقوتابی، مامۆستا، کڕیار، نەخۆش |
| Placesشوێن | cities, branches, classrooms, bus routesشار، لق، پۆل، هێڵی پاس |
| Thingsشت | cars, books, products, buildingsئۆتۆمبێل، کتێب، کاڵا، باڵەخانە |
| Organisationsدامەزراوە | colleges, departments, suppliers, football teamsکۆلێژ، بەش، دابینکەر، تیپی تۆپی پێ |
| Eventsڕووداو | enrolments, payments, matches, hospital visitsتۆمارکردن، پارەدان، یاری، سەردانی نەخۆشخانە |
| Conceptsچەمک | courses, bank accounts, projects, complaintsوانە، هەژماری بانک، پرۆژە، سکاڵا |
Keep two levels apart. STUDENT is an entity type – the set of all students; Aram is one entity, an instance of it. In the same way takes is a relationship type and 'Aram takes DB101' is one relationship, and name is an attribute while 'Aram' is one of its values. A diagram shows only the types; the instances become rows later.
دوو ئاست لێک جیا بکەرەوە. «قوتابی» جۆرێکی – کۆمەڵەی هەموو قوتابیان؛ ئارام یەک ، نموونەیەکی ئەو جۆرە. بە هەمان شێوە دەخوێنێت جۆرێکی و «ئارام DB101 دەخوێنێت» یەک ، nameیش و «ئارام» یەکێکە لە نرخەکانی. هێڵکارییەکە تەنها جۆرەکان پیشان دەدات؛ نموونەکان دواتر دەبنە .
Attributesخەسڵەتەکان
A fact that describes an , such as a student's name or birth date. In an it is drawn as an oval; in a table it becomes a column ().
ڕاستییەکە کە وەسف دەکات، وەک ناو یان ڕێکەوتی لەدایکبوونی قوتابییەک. لە بە شێوەیەکی هێلکەیی دەکێشرێت؛ لە خشتەدا دەبێتە ستوونێک ().
An entity is represented by a set of attributes, sometimes called properties. They describe the entity's characteristics. The course writes a customer like this:
بە کۆمەڵێک دەردەبڕدرێت، کە هەندێک جار پێیان دەوترێت تایبەتمەندی. ئەوان سیفەتەکانی وەسف دەکەن. کۆرسەکە کڕیارێک بەم شێوەیە دەنووسێت:
customer = (customer_id, customer_name, date_of_birth)The course names three types of attribute: simple, composite and derived. The type matters, because it decides how the attribute is drawn in the diagram and how it becomes a column later.
کۆرسەکە ناوی سێ جۆر دەهێنێت: سادە، لێکدراو و داتاشراو. جۆرەکە گرنگە، چونکە بڕیار دەدات لە هێڵکارییەکەدا چۆن دەکێشرێت و دواتر چۆن دەبێتە .
Every attribute also has a domain: the set of values it may take. A name is text, never a number; an age is never negative; a mark lies between 0 and 100. When the design becomes tables, the domain becomes the column's data type and its rules (the words of the relational model).
هەر هەیە: کۆمەڵەی ئەو نرخانەی دەتوانێت وەریان بگرێت. ناو دەقە، هەرگیز ژمارە نییە؛ تەمەن هەرگیز سالب نییە؛ نمرە لە نێوان 0 و 100دایە. کاتێک دیزاینەکە دەبێتە ، دەبێتە و ڕێساکانی (وشەکانی مۆدێلی پەیوەندیدار).
In Sorani Kurdish, a university lecture on the E-R model: entities, attributes and their types, relationships and cardinality.
بە کوردیی سۆرانی، وانەیەکی زانکۆ دەربارەی : ، و جۆرەکانیان، و .
In Sorani, plays 1:40–4:55: attributes, then their types (simple and composite, single- and multi-valued, derived) on lecture slides.
بە سۆرانی، لە 1:40 تا 4:55 پەخش دەبێت: ، پاشان جۆرەکانیان ( و ، و ، ) لەسەر سلایدەکانی وانە.
Attributesخەسڵەتەکان
Three pairs of attribute typesسێ جووتە جۆری خەسڵەت
| Pairجووت | One sideلایەک | Other sideلایەکەی تر |
|---|---|---|
| Can it be split?دەکرێت دابەش بکرێت؟ | simple – no (gender)سادە – نا (ڕەگەز) | composite – yes (name, address)لێکدراو – بەڵێ (ناو، ناونیشان) |
| How many values?چەند نرخ؟ | single-valued – one (date of birth)تاکنرخ – یەک (ڕێکەوتی لەدایکبوون) | multi-valued – many, double oval (phones)فرەنرخ – چەند دانەیەک، هێلکەیی دووانە (مۆبایلەکان) |
| Stored or worked out?هەڵگیراو یان ژمێردراو؟ | stored – kept in the database (date of birth)هەڵگیراو – لە دەمێنێتەوە (ڕێکەوتی لەدایکبوون) | derived – computed, dashed oval (age)داتاشراو – دەژمێردرێت، هێلکەیی پچڕپچڕ (تەمەن) |
Attributesخەسڵەتەکان
Simple and composite attributesخەسڵەتە سادەکان و خەسڵەتە لێکدراوەکان
A simple attribute cannot be divided into smaller attributes. Gender is simple: it has no meaningful parts.
ناکرێت بۆ بچووکتر دابەش بکرێت. ڕەگەز سادەیە: هیچ بەشێکی بەمانای نییە.
A composite attribute can be divided into smaller parts, and each part is a simple attribute with its own meaning. Examples: a name and an address. In Kurdistan a full name often has three parts – first name, father's name and grandfather's name – and an address can be split into city, district and street. In a diagram, a composite attribute is an oval joined to the ovals of its parts.
دەکرێت بۆ چەند بەشێکی بچووکتر دابەش بکرێت و هەر بەشێکیش و واتای خۆی هەیە. نموونە: ناو و ناونیشان. لە کوردستاندا ناوی تەواو زۆرجار سێ بەشی هەیە – ناوی خۆی، ناوی باوک و ناوی باپیر – و ناونیشانیش دەکرێت بۆ شار، گەڕەک و شەقام دابەش بکرێت. لە هێڵکارییەکدا هێلکەییەکە کە بە هێلکەیی بەشەکانییەوە بەستراوە.
Attributesخەسڵەتەکان
Single-valued and multi-valued attributesخەسڵەتە تاکنرخەکان و خەسڵەتە فرەنرخەکان
A single-valued attribute can have only one value for each entity. Examples: gender, a student ID, a national ID card number.
بۆ هەر تەنها یەک هەیە. نموونە: ڕەگەز، ژمارەی قوتابی و ژمارەی کارتی نیشتمانی.
A multi-valued attribute can have many values for one entity. A person may have several university degrees (BSc, MSc, PhD), or several phone numbers. In an E-R diagram a multi-valued attribute is drawn with a double oval.
دەکرێت بۆ یەک چەندین هەبێت. کەسێک دەکرێت چەند بڕوانامەیەکی زانکۆیی هەبێت (بەکالۆریۆس، ماستەر، دکتۆرا)، یان چەند ژمارە مۆبایلێک. لە بە هێلکەیی دووانە دەکێشرێت.
Attributesخەسڵەتەکان
Stored and derived attributesخەسڵەتی هەڵگیراو و داتاشراو
A derived attribute can be computed from other attributes. The classic example is age, which is worked out from the date of birth. In a diagram a derived attribute is drawn with a dashed oval. Attributes that are really kept in the database, such as the date of birth, are called stored attributes.
دەکرێت لە ترەوە بژمێردرێت. نموونە ناسراوەکەی تەمەنـە، کە لە ڕێکەوتی لەدایکبوونەوە دەردەهێنرێت. لە هێڵکارییەکدا بە هێلکەیی پچڕپچڕ دەکێشرێت. ئەو بە ڕاستی لە هەڵدەگیرێن، وەک ڕێکەوتی لەدایکبوون، پێیان دەوترێت هەڵگیراو.
Identifiers (key attributes)ناسێنەرەکان (خەسڵەتە کلیلەییەکان)
The (or group of attributes) whose value is different for every entity, so it tells one entity from another. In an its name is underlined; in a table it becomes the .
بریتییە لەو (یان کۆمەڵە خەسڵەتەی) کە نرخەکەی بۆ هەر قەوارەیەک جیاوازە، بۆیە قەوارەیەک لە قەوارەیەکی تر جیا دەکاتەوە. لە هێڵ بەژێر ناوەکەیدا دەهێنرێت؛ لە خشتەدا دەبێتە .
The identifier, or key attribute, is the attribute whose value is different for every entity, so it tells one entity from another – like student_id for students. In an E-R diagram a key attribute has its name underlined inside the oval.
ناسێنەر، یان ، ئەو کە بۆ هەر جیاوازە، بۆیە لە یەکێکی تر جیا دەکاتەوە – وەک student_id بۆ قوتابیان. لە ناوی لەناو هێلکەییەکەدا هێڵی بەژێردا دێت.
When the design becomes tables, the identifier becomes the table's primary key, and keys are also used to link tables to each other (foreign keys). Keys have a whole lesson of their own: Database keys.
کاتێک دیزاینەکە دەبێتە ، ناسێنەرەکە دەبێتە و بۆ بەستنەوەی بە یەکترەوەش بەکار دێن (). وانەیەکی تەواوی تایبەت بە خۆیان هەیە: کلیلەکانی بنکەدراوە.
Relationshipsپەیوەندییەکان
A link between two or more , such as 'a student takes a course'. Its can be one-to-one, one-to-many or many-to-many. In a database it is made with a .
بەستنەوەیەکە لە نێوان دوو یان زیاتردا، وەک «قوتابی وانەیەک دەخوێنێت». دەکرێت یەک بۆ یەک، یەک بۆ زۆر یان زۆر بۆ زۆر بێت. لە بە دروست دەکرێت.
A relationship is an association among two or more entities: a student takes a course, a dean manages a college. In a diagram it is drawn as a diamond, with a verb inside and lines to the entity sets that take part. Most relationships link two entity sets; a few link three.
پەیوەستبوونێکە لە نێوان دوو یان زیاتردا: قوتابییەک وانەیەک دەخوێنێت، ڕاگرێک کۆلێژێک بەڕێوە دەبات. لە هێڵکارییەکدا وەک ئەڵماسی دەکێشرێت، کارێک لەناویدایە و هێڵ بەرەو دەڕوات کە بەشدارن. زۆربەی دوو دەبەستنەوە؛ هەندێکی کەمیان سێ.
A relationship can also have attributes of its own – the grade on takes, the hours on works on – drawn as an oval joined to the diamond (attributes of a relationship).
دەشتوانێت خۆی هەبێت – نمرە لەسەر دەخوێنێت، ژمارەی کاتژمێرەکان لەسەر کار دەکات – کە وەک هێلکەییەک دەکێشرێن و بە ئەڵماسییەکەوە دەبەسترێن (خەسڵەتەکانی پەیوەندییەک).
Relationshipsپەیوەندییەکان
The three types: 1:1, 1:N and M:Nسێ جۆرەکە: 1:1، 1:N و M:N
How many of one table (or entities of one set) can be related to how many of another: one-to-one (1:1), one-to-many (1:M) or many-to-many (M:M).
ئەوەیە کە چەند لە خشتەیەک (یان قەوارەی کۆمەڵەیەک) دەکرێت پەیوەندییان بە چەند دانەیەکی خشتەیەکی ترەوە هەبێت: یەک بۆ یەک (1:1)، یەک بۆ زۆر (1:M) یان زۆر بۆ زۆر (M:M).
How many entities on one side can be linked to how many on the other side is called the cardinality of the relationship (textbooks also say mapping cardinality). There are three types:
ئەوەی چەند لە لایەکەوە دەتوانن بە چەند دانەیەک لە لایەکەی ترەوە ببەسترێنەوە، پێی دەوترێت (کتێبەکان mapping cardinalityـیشی پێ دەڵێن). سێ جۆری هەیە:
- One to one (1:1) – each record on one side is related to one record on the other side.
- One to many (1:M) – each record on one side is related to many records on the other side.
- Many to many (M:M) – many records on one side are related to many records on the other side.
- (
1:1) – هەر لە لایەکەوە بە یەک لە لایەکەی ترەوە پەیوەستە. - (
1:M) – هەر لە لایەکەوە بە چەندین لە لایەکەی ترەوە پەیوەستە. - (
M:M) – چەندین لە لایەکەوە بە چەندین لە لایەکەی ترەوە پەیوەستن.
Relationshipsپەیوەندییەکان
Relationship examplesنموونەی پەیوەندییەکان
- One to one (1:1): the dean of a college is related to the college in a 1:1 relationship: each college has one dean, and each dean manages one college.
- One to many (1:M): a painter paints many different paintings, but each painting is painted by only that one painter. So the painter (one) is related to the paintings (many).
- Many to many (M:M): a student can take many courses, and each course can be taken by many students.
- Two relationships between the same entity sets: lecturers are members of departments (M:N – a lecturer may belong to two departments), and one lecturer heads each department (1:1). Each meaning gets its own diamond (two relationships).
- (
1:1): ڕاگری کۆلێژێک بە پەیوەندیی1:1بە کۆلێژەکەوە بەستراوە: هەر کۆلێژێک یەک ڕاگری هەیە و هەر ڕاگرێک یەک کۆلێژ بەڕێوە دەبات. - (
1:M): وێنەکێشێک چەندین تابلۆی جیاواز دەکێشێت، بەڵام هەر تابلۆیەک تەنها ئەو یەک وێنەکێشە کێشاویەتی. بۆیە وێنەکێش (یەک) بە تابلۆکان (زۆر) پەیوەستە. - (
M:M): قوتابییەک دەتوانێت چەندین وانە بخوێنێت و هەر وانەیەکیش دەکرێت چەندین قوتابی بیخوێنن. - دوو لە نێوان هەمان : مامۆستایان ئەندامی بەشەکانن (
M:N– مامۆستایەک دەکرێت سەر بە دوو بەش بێت) و هەر بەشێک یەک مامۆستا سەرۆکایەتیی دەکات (1:1). هەر واتایەک ئەڵماسیی خۆی وەردەگرێت (دوو پەیوەندی).
The picture below does not show the E-R diagram; it shows real entities and links (an instance diagram). On the left are lecturers, on the right courses, and each small square in the middle is one “teaches” link.
وێنەی خوارەوە پیشان نادات؛ و بەستنەوە ڕاستەقینەکان پیشان دەدات. لە لای چەپ مامۆستاکان، لە لای ڕاست وانەکان و هەر چوارگۆشەیەکی بچووک لە ناوەڕاستدا یەک بەستنەوەی «دەیڵێتەوە»یە.
Relationshipsپەیوەندییەکان
M:N needs a third tableM:N پێویستی بە خشتەیەکی سێیەم هەیە
A many-to-many relationship cannot be built directly between two tables. In a relational database it becomes two one-to-many relationships joined by a link table (a junction table). Each row of the link table holds one pair: which student takes which course.
ناکرێت ڕاستەوخۆ لە نێوان دوو دروست بکرێت. لە دەبێتە دوو کە بە بەیەکەوە بەستراون. هەر یەک جووت هەڵدەگرێت: کام قوتابی کام وانە دەخوێنێت.
student_id | course_code |
|---|---|
| 101 | CSC1234 |
| 101 | CSC3399 |
| 102 | CSC1234 |
| 103 | CSC4567 |
student → takes is one-to-many, and course → takes is one-to-many. Together they give the many-to-many relationship. How every part of an E-R diagram becomes tables is shown in The development life cycle; the keys that join the tables are explained in Database keys.
student ← takes یەک بۆ زۆرە و course ← takesیش یەک بۆ زۆرە. پێکەوە دروست دەکەن. ئەوەی هەر بەشێکی چۆن دەبێتە لە سووڕی ژیانی گەشەپێدانی بنکەدراوە پیشان دراوە؛ ئەو بەیەکەوە دەبەستنەوە لە کلیلەکانی بنکەدراوە ڕوون کراونەتەوە.
Shows why students and classes cannot be linked directly and how a third (joining) table with both keys solves a many-to-many relationship.
پیشان دەدات بۆچی ناکرێت قوتابی و پۆل ڕاستەوخۆ بە یەکەوە ببەسترێنەوە و چۆن سێیەم () کە هەردوو تێدایە، چارەسەر دەکات.
Whole video: the student-and-class example becomes two one-to-many links through a junction table.
هەموو ڤیدیۆکە: نموونەی قوتابی و پۆل لە ڕێگەی دەبێتە دوو .
Weak entitiesقەوارە لاوازەکان
An that cannot be identified by its own alone and cannot exist without an 'owner' entity. It is identified by the owner's key together with its own .
کە تەنها بە خۆی ناناسرێتەوە و بەبێ قەوارەیەکی «خاوەن» بوونی نییە. بە کلیلی خاوەنەکەی لەگەڵ خۆی دەناسرێتەوە.
Some entities cannot be identified by their own attributes. In a clinic in Sulaymaniyah, each patient's visits are numbered 1, 2, 3… Visit number 2 exists for hundreds of patients, so it means nothing until you know whose visit it is. Such an entity is a weak entity. It depends on a strong (owner) entity – here Patient – and it is identified by the owner's key together with its own partial key (also called the discriminator): visit_no. The full key of a visit is (patient_id, visit_no).
هەندێک بە خۆیان ناناسرێنەوە. لە نۆرینگەیەک لە سلێمانی، سەردانەکانی هەر نەخۆشێک ژمارە دەکرێن 1، 2، 3… سەردانی ژمارە 2 بۆ سەدان نەخۆش هەیە، بۆیە هیچ مانایەکی نییە تا نەزانیت سەردانی کێیە. ئەم جۆرە پێی دەوترێت . پشت بە (خاوەن) دەبەستێت – لێرەدا نەخۆش – و بە خاوەنەکەی لەگەڵ خۆی دەناسرێتەوە: visit_no. تەواوی سەردانێک (patient_id, visit_no)ـە.
- A weak entity set is drawn as a double rectangle.
- The relationship that links it to its owner is the identifying relationship, drawn as a double diamond.
- The partial key is underlined with a dashed line.
- بە لاکێشەی دووهێڵی دەکێشرێت.
- ئەو بە خاوەنەکەیەوە دەیبەستێتەوە و بە ئەڵماسیی دووهێڵی دەکێشرێت.
- هێڵێکی پچڕپچڕی بەژێردا دێت.
Weak entitiesقەوارە لاوازەکان
Total and partial participationبەشداریی تەواو و بەشداریی بەشەکی
Participation says whether every entity of a set must take part in a relationship.
بەشداری دەڵێت ئایا هەموو لە کۆمەڵەیەکدا دەبێت لە بەشدار بێت یان نا.
- Total participation – every entity must take part; drawn as a double line. Every visit belongs to a patient, so Visit's participation in “has” is total.
- Partial participation – some entities may take no part; drawn as a single line. A patient who has just registered has no visits yet, so Patient's participation is partial.
- – هەموو دەبێت بەشدار بێت؛ بە هێڵی دووانە دەکێشرێت. هەموو سەردانێک سەر بە نەخۆشێکە، بۆیە بەشداریی «سەردان» لە «هەیەتی»دا تەواوە.
- – دەکرێت هەندێک بەشدار نەبن؛ بە هێڵی تاک دەکێشرێت. نەخۆشێک کە تازە ناوی تۆمار کراوە هێشتا هیچ سەردانێکی نییە، بۆیە بەشداریی «نەخۆش» بەشەکییە.
A weak entity always has total participation in its identifying relationship, because it cannot exist without its owner. Participation is a different question from cardinality: cardinality asks how many, participation asks must there be at least one.
هەمیشە لە بەشداریی تەواوی هەیە، چونکە بەبێ خاوەنەکەی بوونی نییە. بەشداری پرسیارێکی جیاوازە لە : دەپرسێت چەند، بەشداری دەپرسێت ئایا دەبێت لانیکەم یەکێک هەبێت.
| Relationship | Total (double line)تەواو (هێڵی دووانە) | Partial (single line)بەشەکی (هێڵی تاک) |
|---|---|---|
| Lecturer works in Departmentمامۆستا لە بەشدا کار دەکات | every lecturer works in a departmentهەموو مامۆستایەک لە بەشێکدا کار دەکات | a new department may have no lecturer yetلەوانەیە بەشێکی نوێ هێشتا هیچ مامۆستایەکی نەبێت |
| Student takes Courseقوتابی وانە دەخوێنێت | every registered student takes at least one courseهەموو قوتابییەکی تۆمارکراو لانیکەم یەک وانە دەخوێنێت | an optional course may have no students this termلەوانەیە وانەیەکی هەڵبژاردەیی ئەم وەرزە هیچ قوتابییەکی نەبێت |
Reading an E-R diagramخوێندنەوەی هێڵکاریی قەوارە و پەیوەندی
- Rectanglesلاکێشەکان
Find the rectangles first: they are the entities (double rectangles are weak entities).
سەرەتا لاکێشەکان بدۆزەرەوە: ئەوان (لاکێشەی دووهێڵی ).
- Ovalsهێلکەییەکان
Then the ovals around each rectangle: its attributes. Look for the underlined key, double ovals and dashed ovals.
پاشان هێلکەییەکانی دەوری هەر لاکێشەیەک: . بەدوای هێڵ لە ژێردراو، هێلکەیی دووانە و هێلکەیی پچڕپچڕدا بگەڕێ.
- Diamonds and linesئەڵماسی و هێڵەکان
Follow each line from a rectangle to a diamond: the diamond's verb is the relationship.
بەدوای هەر هێڵێکدا بڕۆ لە لاکێشەیەکەوە بۆ ئەڵماسییەک: کاری ناو ئەڵماسییەکە .
- Numbersژمارەکان
Read the numbers at each end (1, N, M) in both directions, and notice double lines (total participation).
ژمارەکانی هەر سەرێک (1، N، M) لە هەردوو ئاراستەوە بخوێنەوە و ئاگات لە هێڵە دووانەکان بێت ().
The course gives two worked examples. Example 1 is the lecturer–teaches–course picture you saw in Relationship examples. Example 2 is a school-marks database, on the next screens.
کۆرسەکە دوو نموونەی کارکراو دەدات. نموونەی 1 ئەو وێنەی مامۆستا–دەیڵێتەوە–وانەیەیە کە لە نموونەی پەیوەندییەکان بینیت. نموونەی 2 نمرەی قوتابخانەیە، لە شاشەکانی داهاتوودا.
Reading an E-R diagramخوێندنەوەی هێڵکاریی قەوارە و پەیوەندی
Example 2: a database diagram, not an E-R diagramنموونەی 2: هێڵکاریی بنکەدراوە، نەک هێڵکاریی قەوارە و پەیوەندی
The two handwritten notes in the course picture (removed above because of their spelling mistakes) said: MarkType holds the kinds of mark – exam, test, seminar and quiz; Terms are the semesters – first term and second term.
دوو تێبینییە دەستنووسەکەی وێنەکەی کۆرسەکە (کە لە سەرەوە بەهۆی هەڵەی نووسینەکانیانەوە لابراون) دەیانگوت: MarkType جۆرەکانی نمرە هەڵدەگرێت – تاقیکردنەوە، تێست، سیمینار و کویز؛ Terms وەرزەکانن – وەرزی یەکەم و وەرزی دووەم.
Reading an E-R diagramخوێندنەوەی هێڵکاریی قەوارە و پەیوەندی
The same database as an E-R diagramهەمان بنکەدراوە وەک هێڵکاریی قەوارە و پەیوەندی
Here is Example 2 drawn properly as an E-R diagram. The lookup tables MarkType and PersonType become simple attributes (mark_type), and Person and StudentData are joined into one entity, STUDENT.
ئەمە نموونەی 2یە کە بە دروستی وەک کێشراوە. یارمەتیدەری MarkType و PersonType دەبنە (mark_type) و Person و StudentData دەکرێنە یەک : «قوتابی».
Look at MARK: a student gets many marks, and a subject has many marks. MARK sits between STUDENT and SUBJECT exactly as a junction table does – the many-to-many link “a student is marked in many subjects; a subject marks many students” becomes two one-to-many relationships.
سەیری «نمرە» بکە: قوتابییەک چەندین نمرە وەردەگرێت و وانەیەکیش چەندین نمرەی هەیە. «نمرە» ڕێک وەک لە نێوان «قوتابی» و «وانە»دایە – بەستنەوە زۆر بۆ زۆرەکەی «قوتابییەک لە چەندین وانەدا نمرە وەردەگرێت؛ وانەیەک بە چەندین قوتابی نمرە دەدات» دەبێتە دوو .
From a text to a diagramلە دەقەوە بۆ هێڵکاری
Exams and real projects start with a text: the rules of a business. Its grammar points to the diagram – an idea that also comes from Peter Chen.
تاقیکردنەوە و پرۆژە ڕاستەقینەکان بە دەقێک دەست پێدەکەن: یاساکانی کارێک. ڕێزمانی دەقەکە ئاماژە بۆ هێڵکارییەکە دەکات – بیرۆکەیەک کە ئەویش هی Peter Chenـە.
- Nounsناوەکان
Common nouns (lecturer, course, customer) become entity types. A proper noun – Aram, Erbil – names one entity, an instance, not a type.
ناوە گشتییەکان (مامۆستا، وانە، کڕیار) دەبنە جۆری . ناوی تایبەت – ئارام، هەولێر – ناوی یەک ، نموونەیەک، نەک جۆرێک.
- Verbsکارەکان
Verbs (teaches, buys, belongs to) become relationships. For each one ask 'how many?' in both directions – that gives the cardinality – and 'must every …?' – that gives the participation.
کارەکان (دەیڵێتەوە، دەکڕێت، سەر بەیە) دەبنە . بۆ هەر یەکێکیان لە هەردوو ئاراستەوە بپرسە «چەند؟» – ئەمە دەدات – و «ئایا دەبێت هەموو … ؟» – ئەمە بەشداری دەدات.
- Describing wordsوشە وەسفکەرەکان
Adjectives and describing nouns (a red car, a staff number, a course title) become attributes of the entity they describe.
ئاوەڵناو و ناوە وەسفکەرەکان (ئۆتۆمبێلێکی سوور، ژمارەی کارمەندی، ناونیشانی وانە) دەبنە ئەو وەسفی دەکەن.
- Amounts on a verbبڕ لەسەر کار
Words that describe the action itself – for 25,000 dinars, for four hours a week – become attributes of the relationship.
ئەو وشانەی خودی کارەکە وەسف دەکەن – بە 25,000 دینار، چوار کاتژمێر لە هەفتەیەکدا – دەبنە .
- Drawبیکێشە
Draw the rectangles, then the diamonds and lines with their numbers, then the ovals. Underline each key.
لاکێشەکان بکێشە، پاشان ئەڵماسییەکان و هێڵەکان بە ژمارەکانیانەوە، پاشان هێلکەییەکان. هێڵ بە ژێر هەموو کلیلێکدا بکێشە.


From a text to a diagramلە دەقەوە بۆ هێڵکاری
Four rules for doubtful casesچوار یاسا بۆ حاڵەتە گوماناوییەکان
Grammar is a guide, not a law. When you are not sure whether a noun deserves a rectangle, these four rules decide:
ڕێزمان ڕێنیشاندەرە، نەک یاسا. کاتێک دڵنیا نیت ناوێک شایەنی لاکێشەیەکە یان نا، ئەم چوار یاسایە بڕیار دەدەن:
- Every entity type must matter. Keep it only if the organisation needs to store facts about it.
- One property, one owner: an attribute. A noun with only one property that belongs to only one entity type is an attribute – the colour of a car, not a COLOUR entity.
- Only one instance: not an entity type. 'The dealer' in a text about one car dealer is the whole database, not a rectangle.
- A relationship that needs its own number becomes an entity. An invoice has an invoice number, a date and a price, so it is an entity INVOICE, not a diamond writes.
- هەموو جۆرێکی دەبێت گرنگ بێت. تەنها کاتێک بیهێڵەوە کە دامەزراوەکە پێویستی بە هەڵگرتنی ڕاستی دەربارەی هەبێت.
- یەک تایبەتمەندی، یەک خاوەن: . ناوێک کە تەنها یەک تایبەتمەندیی هەبێت و تەنها سەر بە یەک جۆری بێت – ڕەنگی ئۆتۆمبێل، نەک بە ناوی «ڕەنگ».
- تەنها یەک نموونە: جۆرێکی نییە. «نوێنەرەکە» لە دەقێکدا دەربارەی یەک نوێنەری ئۆتۆمبێل هەموو ، نەک لاکێشەیەک.
- کە ژمارەی تایبەتی خۆی پێویست بێت دەبێتە . پسوڵەی فرۆشتن ژمارە، ڕێکەوت و نرخی خۆی هەیە، بۆیە بە ناوی «پسوڵە»، نەک ئەڵماسیی دەینووسێت.
All the symbols on one pageهەموو هێماکان لە یەک لاپەڕەدا
Common mistakesهەڵە باوەکان
| Mistakeهەڵە | What is rightڕاستییەکە |
|---|---|
| Storing age.هەڵگرتنی تەمەن. | Store date_of_birth; age is derived (dashed oval).date_of_birth هەڵبگرە؛ تەمەن داتاشراوە (هێلکەیی پچڕپچڕ). |
| Calling the relationship its participants.ناونانی بە بەشداربووانی. | The participants are the entities; the relationship is the link.بەشداربووان ؛ بەستنەوەکەیە. |
| Reading a relationship in one direction only.خوێندنەوەی تەنها لە یەک ئاراستەوە. | Ask both questions: one A → how many B? one B → how many A?هەردوو پرسیار بکە: یەک A ← چەند B؟ یەک B ← چەند A؟ |
Calling a picture M:N when each course has one lecturer.ناونانی وێنەیەک بە M:N کاتێک هەر وانەیەک یەک مامۆستای هەیە. | That is 1:N. M:N needs “many” on both sides.ئەوە 1:Nـە. M:N پێویستی بە «زۆر» لە هەردوو لا هەیە. |
| Putting several phone numbers in one column.دانانی چەند ژمارە مۆبایلێک لە یەک . | Phones are multi-valued (double oval) and later get their own table.مۆبایلەکان فرەنرخن (هێلکەیی دووانە) و دواتر تایبەتیان دەبێت. |
| Calling an SSMS database diagram an E-R diagram.ناونانی هێڵکاریی SSMS بە . | Boxes with columns, keys and ∞ ends are tables of a database diagram; E-R uses rectangles, ovals and diamonds.سندوقی ستووندار، کلیل و سەری ∞ هێڵکاریی ؛ لاکێشە، هێلکەیی و ئەڵماسی بەکار دەهێنێت. |
Exercisesڕاهێنانەکان
A clinic stores these attributes for a patient: patient_id, full_name (first, father's and grandfather's name), phone_numbers, date_of_birth, age and blood_group. For each one say: key or not, simple or composite, single- or multi-valued, stored or derived – and how it is drawn.
نۆرینگەیەک ئەم بۆ نەخۆشێک هەڵدەگرێت: patient_id، full_name (ناوی خۆی، باوک و باپیر)، phone_numbers، date_of_birth، age و blood_group. بۆ هەر یەکێکیان بڵێ: یان نا، سادەیە یان لێکدراو، تاکنرخە یان فرەنرخ، هەڵگیراوە یان داتاشراو – و چۆن دەکێشرێت.
Show answerوەڵامەکە پیشان بدە
| Attribute | Typesجۆرەکان | Drawn asچۆن دەکێشرێت |
|---|---|---|
patient_id | key, simple, single-valued, stored، سادە، تاکنرخ، هەڵگیراو | oval, name underlinedهێلکەیی، هێڵ لە ژێر ناوەکەیدا |
full_name | composite (three parts), single-valued, storedلێکدراو (سێ بەش)، تاکنرخ، هەڵگیراو | oval joined to three smaller ovalsهێلکەیی کە بە سێ هێلکەیی بچووکترەوە بەستراوە |
phone_numbers | simple, multi-valued, storedسادە، فرەنرخ، هەڵگیراو | double ovalهێلکەیی دووانە |
date_of_birth | simple, single-valued, storedسادە، تاکنرخ، هەڵگیراو | plain ovalهێلکەیی ئاسایی |
age | simple, single-valued, derivedسادە، تاکنرخ، داتاشراو | dashed ovalهێلکەیی پچڕپچڕ |
blood_group | simple, single-valued, storedسادە، تاکنرخ، هەڵگیراو | plain ovalهێلکەیی ئاسایی |
Give the cardinality (1:1, 1:N or M:N) and read it in both directions: (a) a country and its capital city; (b) a governorate and its districts; (c) doctors and patients in a clinic where a patient may see several doctors; (d) bus routes and bus stops in a city.
بنووسە (1:1، 1:N یان M:N) و لە هەردوو ئاراستەوە بیخوێنەوە: (أ) وڵاتێک و پایتەختەکەی؛ (ب) پارێزگایەک و قەزاکانی؛ (ج) دکتۆر و نەخۆش لە نۆرینگەیەکدا کە نەخۆشێک دەتوانێت سەردانی چەند دکتۆرێک بکات؛ (د) هێڵەکانی پاس و وێستگەکانی پاس لە شارێکدا.
Show answerوەڵامەکە پیشان بدە
- (a) 1:1 – a country has one capital; a capital is the capital of one country.
- (b) 1:N – a governorate has many districts; a district is in one governorate.
- (c) M:N – a doctor sees many patients; a patient may see many doctors.
- (d) M:N – a route has many stops; a stop is on many routes. It will need a junction table.
- (أ)
1:1– وڵاتێک یەک پایتەختی هەیە؛ پایتەختێک پایتەختی یەک وڵاتە. - (ب)
1:N– پارێزگایەک چەندین قەزای هەیە؛ قەزایەک لە یەک پارێزگادایە. - (ج)
M:N– دکتۆرێک چەندین نەخۆش دەبینێت؛ نەخۆشێک دەکرێت چەندین دکتۆر ببینێت. - (د)
M:N– هێڵێک چەندین وێستگەی هەیە؛ وێستگەیەک لەسەر چەندین هێڵە. پێویستی بە دەبێت.
Draw the E-R diagram of a clinic. The clinic has departments (number, name). Each doctor (ID, name, one or more phone numbers) works in one department. Patients have an ID, a name and a date of birth; the screen also shows their age. Each patient's visits are numbered 1, 2, 3… and have a date and a diagnosis; each visit is handled by one doctor.
نۆرینگەیەک بکێشە. نۆرینگەکە چەند بەشێکی هەیە (ژمارە، ناو). هەر دکتۆرێک (ناسنامە، ناو، یەک یان چەند ژمارە مۆبایلێک) لە یەک بەشدا کار دەکات. نەخۆشەکان ناسنامە، ناو و ڕێکەوتی لەدایکبوونیان هەیە؛ شاشەکە تەمەنیشیان پیشان دەدات. سەردانەکانی هەر نەخۆشێک ژمارە دەکرێن 1، 2، 3… و بەروار و دەستنیشانکردنی نەخۆشییان هەیە؛ هەر سەردانێک یەک دکتۆر ئەنجامی دەدات.
Hintئاماژە
Start with the rectangles (the things), then add each thing's ovals, then the diamonds. Ask “must every … have one?” to decide double or single lines.
بە لاکێشەکان (شتەکان) دەست پێبکە، پاشان هێلکەییەکانی هەر شتێک زیاد بکە، پاشان ئەڵماسییەکان. بپرسە «ئایا دەبێت هەموو … یەکێکی هەبێت؟» بۆ ئەوەی بڕیار بدەیت هێڵەکە دووانە بێت یان تاک.
Show answerوەڵامەکە پیشان بدە
- Entities: DEPARTMENT, DOCTOR, PATIENT and the weak entity VISIT (double rectangle).
- Keys:
dept_no,doctor_id,patient_id(underlined);visit_nois a partial key (dashed underline). phoneof a doctor is multi-valued (double oval);ageof a patient is derived (dashed oval).- DEPARTMENT 1 – works in – N DOCTOR (every doctor works in a department: double line on the doctor side).
- PATIENT 1 – has – N VISIT: the identifying relationship (double diamond, double line on the visit side).
- DOCTOR 1 – handles – N VISIT (every visit has a doctor: double line on the visit side).
- : بەش، دکتۆر، نەخۆش و سەردان (لاکێشەی دووهێڵی).
- :
dept_no،doctor_id،patient_id(هێڵ لە ژێرەوە)؛visit_no(هێڵی پچڕپچڕ لە ژێرەوە). phoneـی دکتۆر فرەنرخە (هێلکەیی دووانە)؛ageـی نەخۆش داتاشراوە (هێلکەیی پچڕپچڕ).- بەش 1 – کاری تێدا دەکات – N دکتۆر (هەموو دکتۆرێک لە بەشێکدا کار دەکات: هێڵی دووانە لە لای دکتۆر).
- نەخۆش 1 – هەیەتی – N سەردان: (ئەڵماسیی دووهێڵی، هێڵی دووانە لە لای سەردان).
- دکتۆر 1 – ئەنجامی دەدات – N سەردان (هەموو سەردانێک دکتۆرێکی هەیە: هێڵی دووانە لە لای سەردان).
In the course's Example 2, the table Class has the columns ClassId, ClassName and StdId, and the line joins it to StudentData. One class has many students. What goes wrong when a class has 30 students, and how should it be fixed?
لە نموونەی 2ی کۆرسەکەدا، Class ClassId، ClassName و StdIdی هەیە و هێڵەکە بە StudentDataـەوە دەیبەستێتەوە. یەک پۆل چەندین قوتابیی هەیە. کاتێک پۆلێک 30 قوتابیی هەبێت چی هەڵە دەبێت و چۆن چاک دەکرێت؟
Show answerوەڵامەکە پیشان بدە
Class can hold only one StdId per row, so a class of 30 students needs 30 rows that repeat the same class name. The relationship is one class → many students (1:N), and the foreign key belongs on the many side: remove StdId from Class and add ClassId to the student table. (Person and StudentData also repeat the name, date of birth and address – see Normalization.)
Class لە هەر تەنها یەک StdId هەڵدەگرێت، بۆیە پۆلێکی 30 قوتابی پێویستی بە 30 هەیە کە هەمان ناوی پۆل دووبارە دەکەنەوە. یەک پۆل ← چەندین قوتابییە (1:N) و دەبێت لە لایەنی زۆر بێت: StdId لە Class لاببە و ClassId بۆ قوتابی زیاد بکە. (Person و StudentData ناو، ڕێکەوتی لەدایکبوون و ناونیشانیش دووبارە دەکەنەوە – نۆرماڵکردن ببینە.)
Exercisesڕاهێنانەکان
Exercises: reading and checkingڕاهێنان: خوێندنەوە و پشکنین
A planning meeting lists these words: house, phone number, national ID number, computer, product, date, height, order number. Sort them into entities and attributes.
کۆبوونەوەیەکی پلاندانان ئەم وشانە ڕیز دەکات: خانوو، ژمارەی مۆبایل، ژمارەی کارتی نیشتمانی، ، کاڵا، ڕێکەوت، باڵا، ژمارەی داواکاری. بە و پۆلێنیان بکە.
Show answerوەڵامەکە پیشان بدە
- Entities: house, computer, product – each has properties of its own (a computer has a serial number, a model and a price).
- Attributes: phone number, national ID number, date, height and order number – each is one value that describes something else.
- Order number is the key attribute of an ORDER entity that the list does not name. A number usually belongs to the thing it numbers.
- : خانوو، ، کاڵا – هەر یەکەیان تایبەتمەندیی خۆی هەیە ( ژمارەی زنجیرە، مۆدێل و نرخی هەیە).
- : ژمارەی مۆبایل، ژمارەی کارتی نیشتمانی، ڕێکەوت، باڵا و ژمارەی داواکاری – هەر یەکەیان یەک نرخە کە شتێکی تر وەسف دەکات.
- ژمارەی داواکاری بۆ بە ناوی «داواکاری»، کە لیستەکە ناوی نەهێناوە. ژمارە زۆرجار هی ئەو شتەیە کە ژمارەی پێ دەدات.
The diagram below shows four tables of a supermarket chain, drawn like Example 2: PK marks a primary key, and each line has 1 at one end and ∞ at the other. (a) Name the primary key of each table. (b) Name the foreign keys and the table each one points to. (c) Read each line in both directions. (d) Which column of Purchases is not needed, which one needs an explanation, and what is missing?
هێڵکارییەکەی خوارەوە چوار زنجیرە سوپەرمارکێتێک پیشان دەدات، وەک نموونەی دووەم کێشراوە: PK نیشانەی و هەر هێڵێک لە سەرێکی 1 و لە سەرەکەی تری ∞ هەیە. (أ) هەر ناو بهێنە. (ب) و ئەو هەر یەکەیان ئاماژەی بۆ دەکات ناو بهێنە. (ج) هەر هێڵێک لە هەردوو ئاراستەوە بخوێنەوە. (د) کام Purchases پێویست نییە، کامیان ڕوونکردنەوەی پێویستە و چی کەمە؟
Show answerوەڵامەکە پیشان بدە
- (a)
supermarket_id,employee_id,product_idandpurchase_id. - (b)
Employees.supermarket_id,Products.supermarket_idandPurchases.supermarket_idpoint toSupermarket;Purchases.product_idpoints toProducts. Each sits at the ∞ end. - (c) One supermarket has many employees, and each employee works in one supermarket. One supermarket has many products and many purchases. One product appears in many purchases, and each purchase is of one product.
- (d)
Purchases.supermarket_idis not needed: the product already belongs to one supermarket, and the two values could disagree.product_priceis right only if it means the price paid on that day (prices change) – a name such asprice_paidsays so. Missing: a date, a customer, and room for several products in one purchase (order lines).
- (أ)
supermarket_id،employee_id،product_idوpurchase_id. - (ب)
Employees.supermarket_id،Products.supermarket_idوPurchases.supermarket_idئاماژە بۆSupermarketدەکەن؛Purchases.product_idئاماژە بۆProductsدەکات. هەر یەکەیان لە سەری ∞دایە. - (ج) یەک سوپەرمارکێت چەندین فەرمانبەری هەیە و هەر فەرمانبەرێک لە یەک سوپەرمارکێتدا کار دەکات. یەک سوپەرمارکێت چەندین کاڵا و چەندین کڕینی هەیە. یەک کاڵا لە چەندین کڕیندا دەردەکەوێت و هەر کڕینێک هی یەک کاڵایە.
- (د)
Purchases.supermarket_idپێویست نییە: کاڵاکە خۆی پێشتر سەر بە یەک سوپەرمارکێتە و دوو نرخەکە دەکرێت ناکۆک بن.product_priceتەنها کاتێک ڕاستە کە واتای ئەو نرخە بێت کە لەو ڕۆژەدا دراوە (نرخەکان دەگۆڕێن) – ناوێکی وەکprice_paidئەمە دەڵێت. کەمە: ڕێکەوت، کڕیار و جێگە بۆ چەند کاڵایەک لە یەک کڕیندا (دێڕەکانی داواکاری).
The task: a university has departments; each department offers courses; each course is made of modules; students enrol in one course and take its modules; each module is taught by a lecturer of the right department. A draft answer has: DEPARTMENT (id, d_name) offers COURSE; COURSE includes MODULE; LECTURER teaches MODULE; DEPARTMENT employs LECTURER; STUDENT (ID, full_name, gender) enrols in COURSE; STUDENT takes MODULE; STUDENT studies with LECTURER. The diamonds have crow's-foot ends, and COURSE, MODULE and LECTURER have no attributes. Find the mistakes and give the cardinalities.
ئەرکەکە: زانکۆیەک بەشی هەیە؛ هەر بەشێک چەند پرۆگرامێک پێشکەش دەکات؛ هەر پرۆگرامێک لە چەند مۆدیولێک پێکدێت؛ قوتابیان لە یەک پرۆگرامدا تۆمار دەکرێن و مۆدیولەکانی دەخوێنن؛ هەر مۆدیولێک مامۆستایەکی هەمان بەش دەیڵێتەوە. وەڵامێکی ڕەشنووس ئەمانەی تێدایە: DEPARTMENT (id، d_name) پێشکەشی دەکات COURSE؛ COURSE لەخۆ دەگرێت MODULE؛ LECTURER دەیڵێتەوە MODULE؛ DEPARTMENT دایدەمەزرێنێت LECTURER؛ STUDENT (ID، full_name، gender) تۆمار دەکرێت لە COURSE؛ STUDENT دەیخوێنێت MODULE؛ STUDENT لەگەڵ دەخوێنێت LECTURER. ئەڵماسییەکان سەری پێی قەلەڕەشیان هەیە و COURSE، MODULE و LECTURER هیچ نییە. هەڵەکان بدۆزەرەوە و بنووسە.
Show answerوەڵامەکە پیشان بدە
- Mixed notation: Chen diamonds with crow's-foot ends. Choose one notation and keep to it.
- Missing keys and attributes: COURSE, MODULE and LECTURER need at least a key each (
course_code,module_code,lecturer_no) and a name or title. - A redundant relationship: studies with is not in the task, and it can be found anyway through takes and teaches. Remove it.
- Cardinalities: DEPARTMENT 1:N COURSE; COURSE 1:N MODULE (M:N if modules are shared between courses); DEPARTMENT 1:N LECTURER; LECTURER 1:N MODULE; STUDENT N:1 COURSE; STUDENT M:N MODULE.
- تێکەڵکردنی شێوازەکان: ئەڵماسیی Chen بە سەری پێی قەلەڕەشەوە. یەک شێواز هەڵبژێرە و پێیەوە پابەند بە.
- کلیل و نییە: COURSE، MODULE و LECTURER هەر یەکەیان لانیکەم کلیلێکیان پێویستە (
course_code،module_code،lecturer_no) لەگەڵ ناو یان ناونیشانێک. - زیادە: لەگەڵ دەخوێنێت لە ئەرکەکەدا نییە و لە ڕێگەی دەیخوێنێت و دەیڵێتەوەشەوە دەدۆزرێتەوە. لای ببە.
- : DEPARTMENT
1:NCOURSE؛ COURSE1:NMODULE (M:Nئەگەر مۆدیولەکان لە نێوان پرۆگرامەکاندا هاوبەش بن)؛ DEPARTMENT1:NLECTURER؛ LECTURER1:NMODULE؛ STUDENTN:1COURSE؛ STUDENTM:NMODULE.
Exercisesڕاهێنانەکان
Exercise: a car dealer in Erbilڕاهێنان: نوێنەرێکی ئۆتۆمبێل لە هەولێر
A car dealer in Erbil sells new and used cars and runs a service workshop. Draw an E-R diagram from its nine business rules:
نوێنەرێکی ئۆتۆمبێل لە هەولێر ئۆتۆمبێلی نوێ و بەکارهاتوو دەفرۆشێت و وەرشەیەکی چاککردنەوەی هەیە. لە نۆ یاساکەی کارەکەیەوە بکێشە:
- A salesperson can sell many cars; each car is sold by exactly one salesperson.
- A customer can buy many cars; each car is sold to exactly one customer.
- For every car sold, the salesperson writes one invoice.
- For every car bought, the customer receives one invoice.
- Someone who only brings a car for service is a customer too; buying a car is not needed.
- When a customer brings one or more cars for repair or service, one service ticket is written for each car.
- The dealer keeps the service history of every car it has serviced, found by the car's serial number.
- A car in for service can be worked on by several mechanics, and a mechanic works on many cars.
- A serviced car may need parts, or none at all (adjusting the engine or cleaning an injector uses no parts).
- فرۆشیارێک دەتوانێت چەندین ئۆتۆمبێل بفرۆشێت؛ هەر ئۆتۆمبێلێک تەنها یەک فرۆشیار دەیفرۆشێت.
- کڕیارێک دەتوانێت چەندین ئۆتۆمبێل بکڕێت؛ هەر ئۆتۆمبێلێک تەنها بە یەک کڕیار دەفرۆشرێت.
- بۆ هەر ئۆتۆمبێلێک کە دەفرۆشرێت، فرۆشیارەکە یەک پسوڵە دەنووسێت.
- بۆ هەر ئۆتۆمبێلێک کە دەکڕدرێت، کڕیارەکە یەک پسوڵە وەردەگرێت.
- کەسێک کە تەنها ئۆتۆمبێلێک بۆ چاککردنەوە دەهێنێت ئەویش کڕیارە؛ کڕینی ئۆتۆمبێل پێویست نییە.
- کاتێک کڕیارێک یەک یان چەند ئۆتۆمبێلێک بۆ چاککردنەوە یان خزمەتگوزاری دەهێنێت، بۆ هەر ئۆتۆمبێلێک یەک پسوڵەی چاککردنەوە دەنووسرێت.
- نوێنەرەکە مێژووی چاککردنەوەی هەموو ئەو ئۆتۆمبێلانە هەڵدەگرێت کە چاکی کردوون و بە ژمارەی زنجیرەی ئۆتۆمبێلەکە دەدۆزرێتەوە.
- ئۆتۆمبێلێک کە بۆ چاککردنەوە هاتووە دەکرێت چەند میکانیکییەک کاری لەسەر بکەن و میکانیکییەکیش لەسەر چەندین ئۆتۆمبێل کار دەکات.
- ئۆتۆمبێلێکی چاککراو لەوانەیە پارچەی پێویست بێت، یان هیچ (ڕێکخستنی بزوێنەر یان پاککردنەوەی ئینجێکتەر هیچ پارچەیەک بەکار ناهێنێت).
Hintئاماژە
Rules 3, 4, 6 and 7 name things that have their own number and date. Ask whether they are links or things.
یاساکانی 3، 4، 6 و 7 ناوی ئەو شتانە دەهێنن کە ژمارە و ڕێکەوتی خۆیان هەیە. بپرسە ئایا بەستنەوەن یان شت.
Show answerوەڵامەکە پیشان بدە
- Entities and keys: SALESPERSON, CUSTOMER, CAR (
serial_no), MECHANIC, PART – and INVOICE and SERVICE TICKET, because each has its own number and date (rule 4 of the decision rules). - Selling (rules 1–4): SALESPERSON 1:N INVOICE, CUSTOMER 1:N INVOICE, INVOICE 1:1 CAR. Through the invoice, a car has one salesperson and one customer.
- Participation (rule 5): single lines at CUSTOMER and CAR – a customer may buy nothing, and a car brought only for service has no invoice. Every invoice needs all three, so INVOICE has double lines.
- Service (rules 6–7): CUSTOMER 1:N SERVICE TICKET and CAR 1:N SERVICE TICKET, one ticket per car per visit. The service history of rule 7 is simply all the tickets of one
serial_no– no extra entity is needed. - Mechanics and parts (rules 8–9): they belong to the ticket, not to the car: SERVICE TICKET M:N MECHANIC, and SERVICE TICKET M:N PART with
quantityon the diamond. Parts are optional, so the ticket's line to uses is single.
- و کلیلەکان: فرۆشیار، کڕیار، ئۆتۆمبێل (
serial_no)، میکانیکی، پارچە – و پسوڵەی فرۆشتن و پسوڵەی چاککردنەوە، چونکە هەر یەکەیان ژمارە و ڕێکەوتی خۆی هەیە (یاسای چوارەمی یاساکانی بڕیاردان). - فرۆشتن (یاساکانی 1 تا 4): فرۆشیار
1:Nپسوڵەی فرۆشتن، کڕیار1:Nپسوڵەی فرۆشتن، پسوڵەی فرۆشتن1:1ئۆتۆمبێل. لە ڕێگەی پسوڵەکەوە، ئۆتۆمبێلێک یەک فرۆشیار و یەک کڕیاری هەیە. - بەشداری (یاسای 5): هێڵی تاک لە لای کڕیار و ئۆتۆمبێل – کڕیارێک دەکرێت هیچ نەکڕێت و ئۆتۆمبێلێک کە تەنها بۆ چاککردنەوە هاتووە پسوڵەی فرۆشتنی نییە. هەموو پسوڵەیەک پێویستی بە هەر سێکیانە، بۆیە پسوڵە هێڵی دووانەی هەیە.
- چاککردنەوە (یاساکانی 6 و 7): کڕیار
1:Nپسوڵەی چاککردنەوە و ئۆتۆمبێل1:Nپسوڵەی چاککردنەوە، بۆ هەر ئۆتۆمبێلێک لە هەر سەردانێکدا یەک پسوڵە. مێژووی چاککردنەوەی یاسای 7 تەنها هەموو پسوڵەکانی یەکserial_noـە – پێویست بە زیادە ناکات. - میکانیکی و پارچەکان (یاساکانی 8 و 9): سەر بە پسوڵەکەن، نەک ئۆتۆمبێلەکە: پسوڵەی چاککردنەوە
M:Nمیکانیکی و پسوڵەی چاککردنەوەM:Nپارچە بەquantityلەسەر ئەڵماسییەکە. پارچەکان ناچاری نین، بۆیە هێڵی پسوڵەکە بۆ بەکاری دەهێنێت تاکە.
Typical mistakes in students' drafts
هەڵە باوەکان لە ڕەشنووسی قوتابیاندا
- Drawing the invoice and the service ticket as diamonds (writes, written): they have their own number, date and price, so they are entities.
- Joining mechanics and parts straight to CAR: then nobody can tell on which visit a mechanic worked or a part was used.
- Drawing CUSTOMER twice, once as a buyer and once for service: one entity type can take part in several relationships.
- Adding a SERVICE HISTORY entity, or putting
serial_noon a SERVICE entity: the history is the set of tickets, andserial_nois the key of CAR.
- کێشانی پسوڵەی فرۆشتن و پسوڵەی چاککردنەوە وەک ئەڵماسی (دەینووسێت، نووسراوە): ژمارە، ڕێکەوت و نرخی خۆیان هەیە، بۆیە .
- بەستنەوەی میکانیکی و پارچەکان ڕاستەوخۆ بە ئۆتۆمبێلەوە: ئەوکات کەس ناتوانێت بزانێت میکانیکییەک لە کام سەرداندا کاری کردووە یان پارچەیەک لە کامیاندا بەکارهاتووە.
- کێشانی کڕیار دوو جار، جارێک وەک کڕیاری ئۆتۆمبێل و جارێک بۆ چاککردنەوە: یەک جۆری دەتوانێت لە چەند بەشدار بێت.
- زیادکردنی بە ناوی «مێژووی چاککردنەوە»، یان دانانی
serial_noلەسەر بە ناوی «چاککردنەوە»: مێژووەکە کۆمەڵەی پسوڵەکانە وserial_noکلیلی ئۆتۆمبێلە.
Exercisesڕاهێنانەکان
Exercises: draw it yourselfڕاهێنان: خۆت بیکێشە
Draw the E-R diagram: an employee may work on any number of projects – none, one or many; each project has at least one employee; every employee belongs to exactly one department; a department must have at least two employees.
بکێشە: فەرمانبەرێک دەکرێت لەسەر هەر ژمارەیەک پرۆژە کار بکات – هیچ، یەک یان چەندین؛ هەر پرۆژەیەک لانیکەم یەک فەرمانبەری هەیە؛ هەر فەرمانبەرێک ڕێک سەر بە یەک بەشە؛ هەر بەشێک دەبێت لانیکەم دوو فەرمانبەری هەبێت.
Show answerوەڵامەکە پیشان بدە
- EMPLOYEE M – works on – N PROJECT: a single line at EMPLOYEE (an employee may have no project) and a double line at PROJECT (every project has someone).
- EMPLOYEE N – belongs to – 1 DEPARTMENT: double lines on both sides.
- 'At least two' cannot be drawn with 1, N and double lines – a double line only says 'at least one'. Write (2,N) next to DEPARTMENT in the (min,max) notation (two slips in the course slides).
- فەرمانبەر M – کار دەکات لەسەر – N پرۆژە: هێڵی تاک لە لای فەرمانبەر (فەرمانبەرێک دەکرێت هیچ پرۆژەیەکی نەبێت) و هێڵی دووانە لە لای پرۆژە (هەموو پرۆژەیەک کەسێکی هەیە).
- فەرمانبەر N – سەر بەیە – 1 بەش: هێڵی دووانە لە هەردوو لا.
- «لانیکەم دوو» بە 1، N و هێڵی دووانە ناکێشرێت – هێڵی دووانە تەنها دەڵێت «لانیکەم یەک». لە شێوازی (min,max)دا لە تەنیشت بەشەوە (2,N) بنووسە (دوو هەڵە لە سلایدەکانی کۆرسەکەدا).
An insurance company in Sulaimani: customers own one or more cars; each car may have any number of recorded accidents; each policy covers one or more cars and has one or more premium payments, each for a period, with a due date and the date it was received. Draw the E-R diagram.
کۆمپانیایەکی بیمە لە سلێمانی: کڕیاران یەک یان چەند ئۆتۆمبێلێکیان هەیە؛ هەر ئۆتۆمبێلێک دەکرێت هەر ژمارەیەک ڕووداوی تۆمارکراوی هەبێت؛ هەر بیمەنامەیەک یەک یان چەند ئۆتۆمبێلێک دەگرێتەوە و یەک یان چەند پارەدانێکی هەیە، هەر یەکەیان بۆ ماوەیەک، بە ڕێکەوتی دانان و ڕێکەوتی وەرگرتن. بکێشە.
Show answerوەڵامەکە پیشان بدە
- CUSTOMER 1:N CAR (owns) and CUSTOMER 1:N POLICY (holds).
- POLICY 1:N CAR (covers), double line at POLICY: a policy covers at least one car.
- CAR M:N ACCIDENT (involved in), with
damage_iqdon the diamond: one accident can involve several cars. - PAYMENT is a weak entity of POLICY:
payment_no(partial key),period,due_date,received_date; double rectangle and double diamond.
- کڕیار
1:Nئۆتۆمبێل (هەیەتی) و کڕیار1:Nبیمەنامە (هەڵیدەگرێت). - بیمەنامە
1:Nئۆتۆمبێل (دەیگرێتەوە)، هێڵی دووانە لە لای بیمەنامە: هەر بیمەنامەیەک لانیکەم یەک ئۆتۆمبێل دەگرێتەوە. - ئۆتۆمبێل
M:Nڕووداو (تێیدا بووە)، بەdamage_iqdلەسەر ئەڵماسییەکە: یەک ڕووداو دەکرێت چەند ئۆتۆمبێلێک بگرێتەوە. - پارەدان بیمەنامەیە:
payment_no()،period،due_date،received_date؛ لاکێشەی دووهێڵی و ئەڵماسیی دووهێڵی.
Design a database for a football team of the Kurdistan league: the matches it played, the score of each match, the players in each match and each player's statistics in each match. The team also wants season totals. Draw the E-R diagram.
بۆ تیپێکی تۆپی پێی خولی کوردستان دیزاین بکە: ئەو یاریانەی کردوویەتی، ئەنجامی هەر یارییەک، یاریزانەکانی هەر یارییەک و ئاماری هەر یاریزانێک لە هەر یارییەکدا. تیپەکە کۆی گشتیی هەر وەرزێکیشی دەوێت. بکێشە.
Show answerوەڵامەکە پیشان بدە
- MATCH (
match_no,match_date,opponent,goals_for,goals_against) and PLAYER (player_no,name,position). - PLAYER M:N MATCH (plays in), with
minutes,goalsandcardson the diamond: they describe one player in one match. - Season totals are derived attributes (dashed ovals): a player's
total_goalsand the team'swinsare counted from the matches, not stored. A project that uses such statistics: predicting football results.
- یاری (
match_no،match_date،opponent،goals_for،goals_against) و یاریزان (player_no،name،position). - یاریزان
M:Nیاری (یاری تێدا دەکات)، بەminutes،goalsوcardsلەسەر ئەڵماسییەکە: یەک یاریزان لە یەک یاریدا وەسف دەکەن. - کۆی وەرز (هێلکەیی پچڕپچڕ):
total_goalsـی یاریزانێک وwinsـی تیپەکە لە یارییەکانەوە دەژمێردرێن، هەڵناگیرێن. پرۆژەیەک کە ئاماری لەم جۆرە بەکار دەهێنێت: پێشبینیکردنی ئەنجامی تۆپی پێ.
Summary and reviewکورتە و پێداچوونەوە
- The E-R model is a conceptual model: entities, their attributes and the relationships between them, drawn as an E-R diagram before any table exists.
- Goals: capture everything needed, store each fact once, prevent mistakes, help discussion.
- Rectangle = entity set; oval = attribute (underlined = key, double = multi-valued, dashed = derived, with part-ovals = composite); diamond = relationship.
- Cardinality: 1:1, 1:N, M:N – read in both directions. M:N becomes a junction table.
- Weak entity (double rectangle) + identifying relationship (double diamond) + partial key (dashed underline). Double line = total participation.
- From a text: common nouns become entity types, verbs relationships, describing words attributes, and amounts on a verb attributes of the relationship.
- Next: recursive and ternary relationships, (min,max), specialisation and aggregation in Beyond the basic E-R model.
- : ، و نێوانیان، کە پێش بوونی هەر وەک دەکێشرێت.
- ئامانجەکان: گرتنەوەی هەموو پێویستییەک، هەڵگرتنی هەر ڕاستییەک یەکجار، ڕێگرتن لە هەڵە و یارمەتیدانی گفتوگۆ.
- لاکێشە = ؛ هێلکەیی = (هێڵ لە ژێرەوە = ، دووانە = فرەنرخ، پچڕپچڕ = داتاشراو، لەگەڵ هێلکەیی بەشەکان = لێکدراو)؛ ئەڵماسی = .
- :
1:1،1:N،M:N– لە هەردوو ئاراستەوە بخوێنەوە.M:Nدەبێتە . - (لاکێشەی دووهێڵی) + (ئەڵماسیی دووهێڵی) + (هێڵی پچڕپچڕ لە ژێرەوە). هێڵی دووانە = .
- لە دەقەوە: ناوە گشتییەکان دەبنە جۆری ، کارەکان ، وشە وەسفکەرەکان و بڕ لەسەر کار .
- دواتر: خۆیی و سێیانی، (min,max)، و لە زیاتر لە مۆدێلی قەوارە و پەیوەندیی بنەڕەتی.
Which attribute type can be worked out from other attributes?کام جۆری خەسڵەت دەکرێت لە خەسڵەتەکانی ترەوە دەربهێنرێت؟
A derived attribute – for example age, from date of birth.
– بۆ نموونە تەمەن، لە ڕێکەوتی لەدایکبوونەوە.
What are the three types of relationship? Give an example of each.سێ جۆرەکەی پەیوەندی چین؟ بۆ هەر یەکێکیان نموونەیەک بهێنەوە.
1:1 (a dean and a college), 1:M (a painter and paintings) and M:M (students and courses).
1:1 (ڕاگر و کۆلێژ)، 1:M (وێنەکێش و تابلۆکان) و M:M (قوتابیان و وانەکان).
How is each kind of attribute drawn?هەر جۆرێکی خەسڵەت چۆن دەکێشرێت؟
Key: underlined name. Multi-valued: double oval. Derived: dashed oval. Composite: an oval joined to the ovals of its parts.
: ناوی هێڵ لە ژێردراو. فرەنرخ: هێلکەیی دووانە. داتاشراو: هێلکەیی پچڕپچڕ. لێکدراو: هێلکەیی کە بە هێلکەیی بەشەکانییەوە بەستراوە.
What is a weak entity, and how is it identified?قەوارەی لاواز چییە و چۆن دەناسرێتەوە؟
An entity that cannot be identified by its own attributes and depends on an owner entity. It is identified by the owner's key plus its own partial key, e.g. (patient_id, visit_no).
کە بە خۆی ناناسرێتەوە و پشت بە خاوەن دەبەستێت. بە خاوەنەکە و خۆی دەناسرێتەوە، بۆ نموونە (patient_id, visit_no).
Videoڤیدیۆ
Watch a videoسەیری ڤیدیۆیەک بکە
A video that viewers liked a lot and praised in their comments, chosen for this lesson.ڤیدیۆیەک کە بینەران زۆریان پێ خۆش بووە و لە کۆمێنتەکانیاندا ستایشیان کردووە، بۆ ئەم وانەیە هەڵبژێردراوە.
From written requirements to an E-R diagram: entities, attributes, relationships, cardinality, weak entities, Chen and crow's foot notation, and turning the diagram into tables.
لە نووسینی تا : ، ، ، ، ، شێوازەکانی Chen و crow's foot، پاشان گۆڕینی بۆ .
Whole video: from written requirements to a finished E-R diagram. At 12:06 the partial key should have a dashed underline, as in this lesson (the author's own correction).
هەموو ڤیدیۆکە: هەنگاو بە هەنگاو لە نووسینی تا تەواوکردنی . لە 12:06دا دەبێت هێڵی ژێر پچڕپچڕ بێت، وەک لەم وانەیەدا (ڕاستکردنەوەی خودی دروستکەری ڤیدیۆکە).
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
Beyond the Basic E-R Model: Recursive, Ternary and Specialised Entitiesزیاتر لە مۆدێلی قەوارە و پەیوەندیی بنەڕەتی: پەیوەندییەکانی خۆیی و سێیانی و قەوارە تایبەتکراوەکان
Related lecturesوانە پەیوەندیدارەکان
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- Silberschatz, Korth and Sudarshan: Database System Concepts, 7th ed., Chapter 6 slides (E-R model: entity sets, complex attributes, mapping cardinalities, participation, weak entity sets)
- Microsoft Learn: Design Database Diagrams (SQL Server Management Studio)
- Wikipedia: Entity–relationship model (Chen 1976; English sentence structure and E-R diagrams)
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.