تصميم قواعد البيانات
9 Questions
0 Views

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

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

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

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

    <p><code>primary key</code></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</p> Signup and view all the answers

    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

    Description

    تتناول هذه المسابقة مراحل تصميم قواعد البيانات مثل التحليل، والرسوم البيانية للعلاقات الكيانية، ومخططات البيانات. ستختبر معرفتك بالخصائص والسمات لمختلف أنواع الكيانات وكذلك العلاقة بينها.

    More Like This

    Database Design ER Diagrams Overview
    10 questions
    Database Design and ER Diagrams
    45 questions
    Use Quizgecko on...
    Browser
    Browser