انتقل إلى المحتوى
أمين أبوزيد
BEG-049

النمذجة العلائقية

  • 6 درس
  • 73 دقيقة قراءة
  • 3 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • الجداول
  • الأعمدة
  • الصفوف
  • المفاتيح الأساسية/الأجنبية
  • العلاقات
  • أساسيات التطبيع (normalization)

تعلّم أولًا

73 دقيقة قراءة · 3 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Model entities as tables with appropriate columns and types.
  2. Choose primary keys and define foreign keys.
  3. Model one-to-many and many-to-many relationships (junction tables).
  4. Normalize a flat table to third normal form and explain the anomalies removed.

الدروس

  1. 01الجداول والصفوف والأعمدة12 د قراءة
  2. 02المفاتيح الأساسية12 د قراءة
  3. 03المفاتيح الأجنبية والعلاقات12 د قراءة
  4. 04العلاقة متعدد-إلى-متعدد (Many-to-many)12 د قراءة
  5. 05التطبيع (Normalization) عملياً12 د قراءة
  6. 06عرض عملي: تطبيع جدول بيانات مكتبة إلى جداول13 د قراءة

المختبر والتمارين

Lab

BEG-049-LAB1 · Library schema

Outcomes: 1–4 · Time: ~3 h Design the ER diagram for books, authors, members, and loans, with columns, types, PKs, and FKs. Have a peer review it. Acceptance: 3NF; relationships correct; peer-reviewed.

Exercises (assessment: normalize a provided spreadsheet)

IDOutcomeTask
BEG-049-EX011Model a members table: choose columns and a type for each.
BEG-049-EX022Choose a primary key for members and say why email is a poor choice.
BEG-049-EX032Add the foreign key that links loans to members and books.
BEG-049-EX043Model "a book can have many authors" with a junction table.
BEG-049-EX053Fix a books table that has a column tags containing "java,sql,web".
BEG-049-EX064Normalize the provided flat spreadsheet to 3NF (list resulting tables).
BEG-049-EX074Name the update, insert, and delete anomalies in the flat sheet.
أظهر الحلول
  • EX01 members(id integer, name text, email text, joined_on date).
  • EX02 id, a generated number; emails can change and may be reused.
  • EX03 loans(id, member_id FK -> members.id, book_id FK -> books.id, loaned_on, due_on, returned_on).
  • EX04 book_authors(book_id, author_id) with a composite PK and two FKs.
  • EX05 Create tags(id, name) and book_tags(book_id, tag_id); one tag per row.
  • EX06 Typically members, books, authors, book_authors, loans, each with a PK; no repeated member or book facts.
  • EX07 Update: a changed phone must be edited on every loan row. Insert: a new member cannot exist before a loan. Delete: deleting a member's only loan loses the member.

الاختبار

Outcomes: O1 tables and columns · O2 keys · O3 relationships · O4 normalization.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1In a table, one row represents:O1
  2. 2Which is the best type for a birth date?O1
  3. 3A primary key must be:O2
  4. 4A foreign key is:O2
  5. 5One author, many books: where does the FK go?O3
  6. 6Many-to-many needs:O3
  7. 7A column holding "java,sql,web" breaks:O3
  8. 83NF means columns depend on:O4
  9. 9Changing one phone number in many rows is an:O4
  10. 10Normalization mainly:O4

الجزء العملي

Assessment: normalize a provided spreadsheet to 3NF (EX06) plus the library ER diagram lab. Pass: at least 8 of 10 quiz questions and a correct 3NF result.

أخطاء شائعة

Comma-separated values in a column; duplicated data across tables.

التقييم

Normalize a provided spreadsheet.

الصلة بالمسار الوظيفي

The Library capstone; data modeling at scale (MID-019).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.