تصميم قواعد البيانات

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

ما هو الفرق بين char(10) و varchar(10)؟

  • `varchar(10)` يحتفظ بـ 10 مساحات في الذاكرة فقط عند الحاجة (correct)
  • `char(10)` يحتفظ بـ 10 مساحات في الذاكرة فقط عند الحاجة
  • `varchar(10)` يحتفظ بـ 10 مساحات في الذاكرة حتى لو لم يتم استخدامها
  • `char(10)` يحتفظ بـ 10 مساحات في الذاكرة حتى لو لم يتم استخدامها (correct)

ما هو الفرق بين create database و drop database؟

create database عبارة عن عبارة SQL تستخدم لإنشاء قاعدة بيانات جديدة، بينما drop database عبارة عن عبارة SQL تستخدم لحذف قاعدة بيانات موجودة.

يمكن استخدام أكثر من كلمة رئيسية (Primary Key) في جدول واحد.

False (B)

ما هو دور constraint في SQL؟

<p>تستخدم <code>constraint</code> لفرض قيود معينة على البيانات في الجدول.</p> Signup and view all the answers

ما هي أنماط constraint المعروفة في SQL؟

<p><code>primary key</code> (A), <code>unique</code> (B), <code>foreign key</code> (C), <code>not null</code> (D), <code>default</code> (E), <code>check</code> (F)</p> Signup and view all the answers

ما هو دور on update في constraint؟

<p>يحدد <code>on update</code> كيفية تحديث البيانات في الجدول المستهدف عند تحديث البيانات في الجدول المصدر المقيد.</p> Signup and view all the answers

ما هو الفرق بين select و retrieve في SQL؟

<p><code>select</code> هي عبارة SQL تستخدم لاختيار البيانات من جدول أو مجموعة من الجداول، بينما <code>retrieve</code> هي طريقة أكثر عمومية تُستخدم لاسترجاع البيانات من قاعدة بيانات.</p> Signup and view all the answers

ما هو دور group by في SQL؟

<p><code>group by</code> تستخدم لتصنيف البيانات في جدول و تجميعها وفقًا لواحد أو أكثر من الأعمدة.</p> Signup and view all the answers

تستخدم الدوال التجميعية Aggregate Functions مع group by clause.

<p>True (A)</p> Signup and view all the answers

Flashcards

كيان قوي

كيان أساسي لا يعتمد على أي كيان آخر لوجوده.

كيان ضعيف

كيان يعتمد على كيان آخر لوجوده ولا يمتلك مفتاحًا أساسيًا.

السمات

مجموعة من السمات التي تصف الكيان بشكل كامل.

نسبة التعدد

نسبة عدد الكيانات في علاقة معينة.

Signup and view all the flashcards

علاقة ثنائية

علاقة مباشرة بين كيانين تُستخدم لربطهما ببعضهما.

Signup and view all the flashcards

علاقة متكررة

علاقة تُستخدم لربط كيان واحد بنفسه.

Signup and view all the flashcards

علاقة ثلاثية

علاقة تربط بين ثلاثة كيانات.

Signup and view all the flashcards

قيود القيمة الافتراضية

تستخدم لتحديد قيمة افتراضية لعمود في الجدول.

Signup and view all the flashcards

char(n)

نوع البيانات في SQL الذي يستخدم لحفظ سلسلة أحرف ذات طول ثابت.

Signup and view all the flashcards

varchar(n)

نوع البيانات في SQL الذي يستخدم لحفظ سلسلة أحرف ذات طول متغير.

Signup and view all the flashcards

قيود

شروط محددة تُطبق على البيانات في الجدول لضمان دقة البيانات.

Signup and view all the flashcards

قيود عدم التكرار

تُشير إلى أن العناصر في عمود معين يجب أن تكون فريدة لا تتكرر.

Signup and view all the flashcards

قيود عدم الفراغ

تُشير إلى أن العناصر في عمود يجب ألا تكون فارغة.

Signup and view all the flashcards

قيود المفاتيح الأساسية

مفتاح أساسي يحدد كل صف بشكل فريد في الجدول.

Signup and view all the flashcards

قيود المفتاح الأجنبي

قيد يشير إلى مفتاح أساسي في جدول آخر.

Signup and view all the flashcards

قيود التحقق

تُستخدم للتأكد من أن البيانات في عمود معين تفي بشروط معينة.

Signup and view all the flashcards

أمر إنشاء الجدول

تُستخدم لإنشاء جدول جديد في قاعدة البيانات.

Signup and view all the flashcards

أمر حذف الجدول

تُستخدم لحذف جدول موجود في قاعدة البيانات.

Signup and view all the flashcards

أمر تعديل الجدول

تُستخدم لتغيير هيكل جدول موجود.

Signup and view all the flashcards

أمر إضافة عمود

تُستخدم لإضافة عمود جديد إلى جدول.

Signup and view all the flashcards

أمر حذف عمود

تُستخدم لحذف عمود موجود من جدول.

Signup and view all the flashcards

أمر إضافة قيد

تُستخدم لإضافة قيد جديد إلى جدول.

Signup and view all the flashcards

أمر حذف قيد

تُستخدم لحذف قيد موجود من جدول.

Signup and view all the flashcards

لغة SQL

لغة استعلامات البيانات المُستخدَمة للتواصل مع قواعد البيانات.

Signup and view all the flashcards

لغة DDL

لغة تعريف البيانات المُستخدَمة لإنشاء وإدارة هيكل البيانات.

Signup and view all the flashcards

لغة DML

لغة معالجة البيانات المُستخدَمة لتغيير البيانات في قواعد البيانات.

Signup and view all the flashcards

أمر الإضافة

تُستخدم لإضافة صف جديد إلى جدول.

Signup and view all the flashcards

أمر الاسترجاع

تُستخدم لاسترجاع البيانات من جدول.

Signup and view all the flashcards

أمر التعديل

تُستخدم لتعديل صف أو أكثر من صفوف في جدول.

Signup and view all the flashcards

أمر الحذف

تُستخدم لحذف صف أو أكثر من صفوف في جدول.

Signup and view all the flashcards

Study Notes

Database Design

  • Database design involves several stages: analysis, entity-relationship diagrams (ER diagrams), schema, Data Definition Language (DDL), and Data Manipulation Language (DML).
  • Analysis focuses on identifying entities (objects) and their attributes (characteristics).
  • Relationships between entities are crucial; examples include 1:1, 1:M, and M:M relationships.

Attributes

  • Key attributes are unique identifiers. Examples include student ID, serial number, and social security number.
  • Composite attributes are composed of multiple parts. An address, for instance, might include street, city, and zip code
  • Multi-valued attributes can hold multiple values for a single entity. Examples include phone numbers and email addresses.
  • Derived attributes are calculated from other attributes. An example is the average grade of students.

Entity Types

  • Strong entities exist independently. Examples include students and courses
  • Weak entities depend on other entities. Examples include dependent in the employee relation, as they depend on the employee for existence
  • Recursive relationships occur when an entity relates to itself. An example is the hierarchical structure of an employee supervisory relationship.
  • Ternary relationships describe relationships between three entities. For example, the relationship between a supplier, a project, and an item.

Database Implementation

  • Converting an ER diagram to a relational database schema involves mapping entities to tables.
  • Attributes become columns and relationships become foreign keys.

SQL

  • SQL (Structured Query Language) is used to manage and manipulate data in databases.
  • DDL (Data Definition Language) commands are used to define tables, columns, and constraints.
  • DML (Data Manipulation Language) commands are used to manipulate data within the database. These include insert, select, update, and delete statements.

Constraints

  • Constraints are rules applied to data integrity and consistency. Common constraints include:
    • Key constraints to ensure uniqueness.
    • not null to prevent missing values.
    • unique to prevent duplicate values.
    • check to enforce specific rules.
  • default value is used to set default values to columns.

Data Types

  • Data types specify the kind of data a column can hold. Note variances between VARCHAR(length) and CHAR(length).

Additional Notes

  • Database management systems (DBMS) use SQL to interact with databases.
  • Common database systems include SQL Server
  • Multiple relationships exist in database design.
  • Proper constraints are essential to maintain data integrity.
  • DDL commands are used to create, modify, and delete tables and columns.
  • DML commands are used to insert, select, update, and delete data from tables.
  • Foreign keys establish relationships between tables.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Database Design Notes PDF

More Like This

Use Quizgecko on...
Browser
Browser