SlideShare une entreprise Scribd logo
1  sur  269
Télécharger pour lire hors ligne
DATABASE
‫البيانات‬ ‫قواعد‬ ‫محور‬
By Eng. Joud Khattab2020
Content
■ Overview.
■ Entity Relational Model.
■ Relational Model.
■ SQL.
■ XML.
■ Normalization.
■ Rational Algebra.
■ MCQ.
2020 By Eng. Joud Khattab
OVERVIEW
2020 By Eng. Joud Khattab
Definitions (‫)تعاريف‬
■‫المعطيات‬ ‫قاعدة‬( :Database)
–،‫المتكررة‬ ‫غير‬ ‫المهيكلة‬ ‫المعطيات‬ ‫من‬ ‫مجموعة‬
–‫تطبيقي‬ ‫برامج‬ ‫عدة‬ ‫قبل‬ ‫من‬ ‫إليها‬ ‫بالوصول‬ ‫يسمح‬ ‫تخزين‬ ‫وسط‬ ‫على‬ ‫المسجلة‬‫ة‬.
■‫المعطيات‬ ‫قواعد‬ ‫إدارة‬ ‫نظام‬( :DBMS: Data Base Management Systems)
–،‫بينها‬ ‫فيما‬ ‫المرتبطة‬ ‫المعطيات‬ ‫من‬ ‫تجمع‬
–‫المعطيات‬ ‫هذه‬ ‫إلى‬ ‫الوصول‬ ‫توفر‬ ‫التي‬ ‫البرامج‬ ‫من‬ ‫ومجموعة‬.
■‫المعطيات‬ ‫قواعد‬ ‫إدارة‬ ‫نظم‬ ‫أهداف‬:
–‫المعطيات‬ ‫واسترجاع‬ ‫تخزين‬ ‫من‬ ‫يمكن‬ ‫وفعال‬ ‫مالئم‬ ‫عمل‬ ‫محيط‬ ‫توفير‬.
–‫التقليدية‬ ‫المعطيات‬ ‫وإدارة‬ ‫تخزين‬ ‫نظم‬ ‫مساوئ‬ ‫على‬ ‫التغلب‬(‫الملفات‬ ‫نظام‬.)
2020 By Eng. Joud Khattab
Database Applications
(‫المعطيات‬ ‫قواعد‬ ‫)تطبيقات‬
■‫الطالب‬ ‫شؤون‬(Universities:)‫العالمات‬ ،‫المواد‬ ،‫التسجيل‬.
■‫البشرية‬ ‫الموارد‬(Human resources:)‫الضرائب‬ ،‫الرواتب‬ ،‫الموظفين‬ ‫سجالت‬.
■‫المبيعات‬(Sales:)‫والمشتريات‬ ‫والمنتجات‬ ‫الزبائن‬
■‫التصنيع‬(Manufacturing:)‫التوريد‬ ،‫الطلبات‬ ،‫التخزين‬ ،‫اإلنتاج‬.
■‫الجوية‬ ‫الخطوط‬(Airlines:)‫الرحالت‬ ‫وتنظيم‬ ‫الحجز‬.
■‫المصارف‬(Banking:)‫المصرفية‬ ‫المعامالت‬.
2020 By Eng. Joud Khattab
Database Problems
(‫المعطيات‬ ‫قواعد‬ ‫)مشاكل‬
■‫المعطيات‬ ‫وتضارب‬ ‫تكرار‬:
–‫ملف‬ ‫من‬ ‫أكثر‬ ‫في‬ ‫المعلومات‬ ‫لنفس‬ ‫تكرار‬ ،‫للملفات‬ ‫مختلفة‬ ‫وأشكال‬ ‫بنى‬.
■‫المعطيات‬ ‫إلى‬ ‫الوصول‬ ‫صعوبة‬:
–‫المختلفة‬ ‫االستفسارات‬ ‫لمعالجة‬ ‫جديدة‬ ‫برامج‬ ‫لكتابة‬ ‫الحاجة‬.
■‫المعطيات‬ ‫تكامل‬ ‫عدم‬:
–‫الموجو‬ ‫الشروط‬ ‫في‬ ‫التغيير‬ ‫أو‬ ‫جديدة‬ ‫شروط‬ ‫إضافة‬ ‫الصعب‬ ‫ومن‬ ‫البرامج‬ ‫ضمن‬ ‫مكتوبة‬ ‫تكون‬ ‫المعطيات‬ ‫على‬ ‫الشروط‬‫دة‬.
–‫مختلفة‬ ‫ملفات‬ ‫في‬ ‫موجودة‬ ‫معطيات‬ ‫بعناصر‬ ‫الشرط‬ ‫يتعلق‬ ‫عندما‬ ‫الصعوبة‬ ‫تزداد‬.
■‫التعديالت‬ ‫تجزئة‬:
–‫جزئية‬ ‫تعديالت‬ ‫لتنفيذ‬ ‫نتيجة‬ ‫صحيحة‬ ‫وغير‬ ‫مستقرة‬ ‫غير‬ ‫بحالة‬ ‫القاعدة‬ ‫تترك‬ ‫أن‬ ‫لألعطال‬ ‫يمكن‬.
■‫المتزامن‬ ‫بالوصول‬ ‫التحكم‬ ‫صعوبة‬:
–‫أخطاء‬ ‫إلى‬ ‫يؤدي‬ ‫أن‬ ‫به‬ ‫المتحكم‬ ‫غير‬ ‫المتزامن‬ ‫للوصول‬ ‫يمكن‬.
–‫مثال‬:‫الوقت‬ ‫نفس‬ ‫في‬ ‫مستخدمين‬ ‫قبل‬ ‫من‬ ‫رصيد‬ ‫وتعديل‬ ‫قراءة‬.
■‫المعلومات‬ ‫أمن‬ ‫تطبيق‬ ‫صعوبة‬.
2020 By Eng. Joud Khattab
DBMS Functions
(‫المعطيات‬ ‫قواعد‬ ‫إدارة‬ ‫أنظمة‬ ‫)وظائف‬
■‫المعلومات‬ ‫مركزية‬.
■‫المعطيات‬ ‫استقالل‬.
■‫إجرائية‬ ‫غير‬ ‫لغات‬ ‫بواسطة‬ ‫المعطيات‬ ‫معالجة‬.
■‫المعطيات‬ ‫بإدارة‬ ‫الخاصة‬ ‫التسهيالت‬.
■‫بفعالية‬ ‫المعطيات‬ ‫إلى‬ ‫الوصول‬.
■‫المعطيات‬ ‫تكرار‬ ‫في‬ ‫التحكم‬.
■‫المعطيات‬ ‫تكامل‬.
■‫المعطيات‬ ‫تقسيم‬.
■‫المعطيات‬ ‫أمن‬ ‫توفير‬.
2020 By Eng. Joud Khattab
Database Structure
(‫المعطيات‬ ‫قواعد‬ ‫)بنية‬
■‫مركزية‬(Centralized)
■‫مخدم‬ ‫زبون‬(Client Server)
■‫تفرعيه‬(Parallel)
■‫موزعة‬(Distributed Database)
2020 By Eng. Joud Khattab
Applications Architecture
(‫التطبيقات‬ ‫)بنية‬
■‫طريق‬ ‫عن‬ ‫المعطيات‬ ‫قاعدة‬ ‫مع‬ ‫التطبيقية‬ ‫البرامج‬ ‫تتصل‬:
–‫تعليمات‬ ‫وجود‬ ‫تقبل‬ ‫البرمجة‬ ‫للغة‬ ‫توسيعات‬(SQL)
–‫برمجية‬ ‫تخاطب‬ ‫واجهة‬(API.)
2020 By Eng. Joud Khattab
Database Levels
(‫التجريد‬ ‫)مستويات‬
■‫المفاهيمي‬ ‫المستوى‬:‫واالرتباطات‬ ‫الكيانات‬ ‫مخططات‬ ‫مثل‬(ERD)
■‫المنطقي‬ ‫المستوى‬:‫النموذج‬ ‫مثل‬‫العالقاتي‬
■‫الفيزيائي‬ ‫المستوى‬.
2020 By Eng. Joud Khattab
ENTITY RELATIONSHIP
MODEL
‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫نموذج‬
2020 By Eng. Joud Khattab
Entity Relationship Model
(‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬
■‫الكيانات‬ ‫هذه‬ ‫بين‬ ‫فيما‬ ‫واالرتباطات‬ ‫الكيانات‬ ‫من‬ ‫مجموعة‬ ‫هي‬ ‫المعطيات‬ ‫قاعدة‬
■‫الكيان‬( :entity)
–‫قاعدة‬ ‫في‬ ‫تخزينها‬ ‫سيجري‬ ‫التي‬ ‫األغراض‬ ‫من‬ ‫غيره‬ ‫عن‬ ‫ومميز‬ ‫موجود‬ ‫غرض‬
‫المعطيات‬:‫المدرس‬ ‫وكيان‬ ‫الطالب‬ ‫كيان‬ ‫مثل‬
–‫واصفات‬ ‫له‬ ‫الكيان‬(attributes:)‫وعنوان‬ ‫اسم‬ ‫شخص‬ ‫لكل‬ ‫مثال‬
–‫رئيسي‬ ‫مفتاح‬ ‫له‬ ‫الكيان‬(primary key)
■‫االرتباط‬( :relationship)
–‫أكثر‬ ‫أو‬ ‫كيانين‬ ‫بين‬ ‫اقتران‬ ‫هو‬.
–‫المدرس‬ ‫مع‬ ‫الطالب‬ ‫ارتباط‬ ‫مثل‬.
–‫واصفات‬ ‫له‬ ‫تكون‬ ‫أن‬ ‫يمكن‬ ً‫أيضا‬ ‫االرتباط‬.
2020 By Eng. Joud Khattab
Entity Relationship Model
(‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬
2020 By Eng. Joud Khattab
Entity Relationship Model
(‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬
■‫الواصفات‬ ‫أنواع‬:
–‫البسيطة‬ ‫الوصفات‬(simple:)‫الراتب‬ ،‫الكنية‬ ،‫االسم‬ ‫مثل‬.
–‫المركبة‬ ‫الواصفات‬(composite:)‫العنوان‬ ،‫الثالثي‬ ‫االسم‬ ‫مثل‬.
–‫القيم‬ ‫المتعددة‬ ‫الواصفات‬(multivalued:)‫الهاتف‬ ‫أرقام‬ ‫مثل‬.
–‫المشتقة‬ ‫الواصفات‬(derived:)‫الراتب‬ ،‫العمر‬ ‫مثل‬ ‫أخرى‬ ‫واصفات‬ ‫من‬ ‫حسابها‬ ‫يتم‬
‫السنوي‬.
2020 By Eng. Joud Khattab
Entity Relationship Model
(‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬
■‫االرتباطات‬ ‫أنواع‬:
–‫االرتباط‬ ‫درجة‬:‫المرتبطة‬ ‫الكيانات‬ ‫عدد‬
■‫رباعية‬ ،‫ثالثية‬ ‫تكون‬ ‫أن‬ ‫يمكن‬ ‫لكن‬ ‫ثنائية‬ ‫االرتباطات‬ ‫معظم‬.
■‫ثالثية‬ ‫عالقة‬ ‫عن‬ ‫مثال‬:‫مشرف‬ ‫مدرس‬ ‫مع‬ ‫مشروع‬ ‫مع‬ ‫طالب‬ ‫عالقة‬.
–‫لالرتباط‬ ‫العددية‬ ‫القيود‬:
■‫لواحد‬ ‫واحد‬(One to one)
■‫لعدة‬ ‫واحد‬(One to many)
■‫لواحد‬ ‫عدة‬(Many to one)
■‫لعدة‬ ‫عدة‬(Many to many)
–‫المشاركة‬ ‫قيود‬:
■‫كاملة‬ ‫مشاركة‬(‫إجبارية‬ ‫عالقة‬)
■‫جزئية‬ ‫مشاركة‬(‫اختيارية‬ ‫عالقة‬)
2020 By Eng. Joud Khattab
Entity Relationship Model
(‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬
■‫المفاتيح‬:
–‫الرئيسي‬ ‫المفتاح‬ ‫أو‬ ‫األعلى‬ ‫المفتاح‬(super key)
■‫الكيانات‬ ‫مجموعة‬ ‫من‬ ‫واحد‬ ‫كيان‬ ‫بتمييز‬ ‫متجمعة‬ ‫تسمح‬ ‫اكثر‬ ‫او‬ ‫واصفا‬ ‫تضم‬ ‫مجموعة‬
‫واحد‬ ‫صف‬ ‫الى‬ ‫المنتمية‬.
–‫المرشح‬ ‫المفتاح‬(candidate key)
■‫هذه‬ ‫من‬ ‫جزئية‬ ‫مجموعة‬ ‫توجد‬ ‫وال‬ ‫الواصفات‬ ‫من‬ ‫مجموعة‬ ‫من‬ ‫مؤلف‬ ‫رئيسي‬ ‫مفتاح‬
‫رئيسيا‬ ‫مفتاحا‬ ‫تكون‬ ‫المجموعة‬.
–‫األولي‬ ‫المفتاح‬(primary key)
■‫البعض‬ ‫بعضها‬ ‫عن‬ ‫الكيانات‬ ‫لتمييز‬ ‫أساسية‬ ‫كطريقة‬ ‫المصمم‬ ‫اختاره‬ ‫مرشح‬ ‫مفتاح‬
‫واحد‬ ‫كيانات‬ ‫صف‬ ‫الى‬ ‫والمنتمية‬.
2020 By Eng. Joud Khattab
Entity Relationship Model
(‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬
■ A software release can be identified either by:
– major/minor version or by the date.
■ (year, major, minor) or (year, month, date, major)
– are super keys (since they are unique)
– but not candidate keys, (since you can remove year or major and the remaining
set will still be a super key)
■ (year, month, date) and (major, minor)
– are candidate keys, since you cannot remove any of the fields from them
without breaking uniqueness.
Year Month Date Major Minor
2008 01 13 0 1
2008 04 23 0 2
2009 11 05 1 0
2010 04 05 1 1
2020 By Eng. Joud Khattab
Entity Relationship Diagram (ERD)
( ‫كيان‬ ‫مخطط‬-‫ارتباط‬ )
One to One One to Many
Many to Many
2020 By Eng. Joud Khattab
Entity Relationship Diagram (ERD)
( ‫كيان‬ ‫مخطط‬-‫ارتباط‬ )
■‫الواصفات‬ ‫من‬ ‫المختلفة‬ ‫األنواع‬ ‫تمثيل‬:
2020 By Eng. Joud Khattab
Entity Relationship Diagram (ERD)
( ‫كيان‬ ‫مخطط‬-‫ارتباط‬ )
■‫الضعيف‬ ‫الكيان‬(weak entity)
–‫اولي‬ ‫مفتاح‬ ‫له‬ ‫ليس‬(primary key)‫عناصره‬ ‫بين‬ ‫يميز‬.
–‫المحدد‬ ‫الكيان‬ ‫أو‬ ‫القوي‬ ‫الكيان‬ ‫يسمى‬ ‫آخر‬ ‫كيان‬ ‫بوجود‬ ‫مرهون‬ ‫وجوده‬.
–‫التحديد‬ ‫عالقة‬ ‫تسمى‬ ‫إجبارية‬ ‫لواحد‬ ‫عدة‬ ‫بعالقة‬ ‫القوي‬ ‫الكيان‬ ‫مع‬ ‫يرتبط‬.
–‫الواحد‬ ‫القوي‬ ‫الكيان‬ ‫ضمن‬ ‫عناصره‬ ‫بين‬ ‫يميز‬ ‫مميز‬ ‫له‬.
–‫القو‬ ‫للكيان‬ ‫الرئيسي‬ ‫والمفتاح‬ ‫المميز‬ ‫من‬ ً‫مؤلفا‬ ‫الرئيسي‬ ‫مفتاحه‬ ‫يصبح‬‫المرتبط‬ ‫ي‬
‫به‬.
2020 By Eng. Joud Khattab
RELATIONAL MODEL
‫النموذج‬‫العالقاتي‬
2020 By Eng. Joud Khattab
FROM ERD TO
RELATIONAL MODEL
‫النموذج‬ ‫إلى‬ ‫واالرتباطات‬ ‫الكيانات‬ ‫نموذج‬ ‫من‬ ‫التحويل‬‫العالقاتي‬
2020 By Eng. Joud Khattab
From ERD to Relational model
■‫البسيطة‬ ‫الواصفات‬ ‫ذات‬ ‫القوية‬ ‫الكيانات‬ ‫تحويل‬:
–‫نفسه‬ ‫الرئيسي‬ ‫والمفتاح‬ ‫نفسها‬ ‫الواصفات‬ ‫لها‬ ‫عالقة‬ ‫إلى‬ ‫الكيان‬ ‫يتحول‬.
■‫الضعيفة‬ ‫الكيانات‬ ‫تحويل‬:
–،‫نفسها‬ ‫الواصفات‬ ‫لها‬ ‫عالقة‬ ‫إلى‬ ‫الضعيف‬ ‫الكيان‬ ‫يتحول‬
–،‫له‬ ‫المحدد‬ ‫القوي‬ ‫للكيان‬ ‫الرئيسي‬ ‫المفتاح‬ ‫واصفات‬ ‫إلى‬ ً‫ة‬‫إضاف‬
–،‫للعالقة‬ ً‫رئيسيا‬ ً‫مفتاحا‬ ‫المميزة‬ ‫الواصفات‬ ‫مع‬ ‫تصبح‬ ‫التي‬
–‫الكيانين‬ ‫بين‬ ‫االرتباط‬ ‫يمثل‬ ً‫خارجيا‬ ً‫مفتاحا‬ ‫وتكون‬.
2020 By Eng. Joud Khattab
From ERD to Relational model
■‫لواحد‬ ‫واحد‬ ‫الروابط‬( :one-to-one)
–‫ال‬ ‫أحد‬ ‫في‬ ‫الموجود‬ ‫الكيان‬ ‫عن‬ ‫الناتجة‬ ‫للعالقة‬ ‫الرئيسي‬ ‫المفتاح‬ ‫إضافة‬ ‫يمكن‬‫طرفين‬
ً‫خارجيا‬ ً‫مفتاحا‬ ‫ليصبح‬ ‫اآلخر‬ ‫الطرف‬ ‫في‬ ‫الموجود‬ ‫الكيان‬ ‫عن‬ ‫الناتجة‬ ‫العالقة‬ ‫إلى‬‫فيها‬.
■‫لعدة‬ ‫واحد‬ ‫الروابط‬( :one-to-many)
–‫الطر‬ ‫في‬ ‫الموجود‬ ‫الكيان‬ ‫عن‬ ‫الناتجة‬ ‫للعالقة‬ ‫الرئيسي‬ ‫المفتاح‬ ‫بإضافة‬ ‫يمكن‬‫ف‬(one)
‫الطرف‬ ‫في‬ ‫الموجود‬ ‫الكيان‬ ‫عن‬ ‫الناتجة‬ ‫العالقة‬ ‫إلى‬(many)ً‫خارجيا‬ ً‫مفتاحا‬ ‫ليصبح‬
‫فيها‬.
■‫لعدة‬ ‫عدة‬ ‫االرتباطات‬( :many-to-many)
–‫الك‬ ‫عن‬ ‫الناتجة‬ ‫للعالقات‬ ‫الرئيسية‬ ‫المفاتيح‬ ‫تتضمن‬ ‫عالقات‬ ‫بإضافة‬ ‫يمكن‬‫يانات‬
‫وي‬ ‫الجديدة‬ ‫للعالقة‬ ‫الرئيسي‬ ‫المفتاح‬ ‫مجتمعة‬ ‫تشكل‬ ‫والتي‬ ‫فيها‬ ‫المشاركة‬‫كل‬ ‫صبح‬
‫منه‬ ‫أتى‬ ‫الذي‬ ‫الكيان‬ ‫وعالقة‬ ‫الجديدة‬ ‫العالقة‬ ‫بين‬ ‫خارجي‬ ‫مفتاح‬ ‫منها‬.‫تضاف‬ ‫ثم‬
‫وجدت‬ ‫إن‬ ‫االرتباط‬ ‫واصفات‬.
2020 By Eng. Joud Khattab
Relational Model
( ‫النموذج‬‫العالقاتي‬ )
■‫عالقة‬/‫المدرس‬ ‫جدول‬
Attributes ‫واصفات‬
(or columns ‫)أعمدة‬
Tuples ‫صفوف‬
(or rows ‫)أسطر‬
2020 By Eng. Joud Khattab
Relational Model
( ‫النموذج‬‫العالقاتي‬ )
■‫المفاتيح‬:
–‫الرئيسي‬ ‫المفتاح‬(primary key)
■‫واصفات‬ ‫مجموعة‬ ‫أو‬ ‫واصفة‬ ‫هو‬‫أصغرية‬‫وحيد‬ ‫بشكل‬ ‫صف‬ ‫تحدد‬.
■‫مثل‬:ID‫للعالقة‬ ‫رئيسي‬ ‫مفتاح‬ ‫هو‬Instructor
–‫الخارجي‬ ‫المفتاح‬(Foreign key)
■‫الع‬ ‫في‬ ‫الواصفات‬ ‫إحدى‬ ‫لقيمة‬ ‫مقابلة‬ ‫قيمة‬ ‫وجود‬ ‫تضمن‬ ‫عالقتين‬ ‫لربط‬ ‫وسيلة‬ ‫هو‬‫القة‬
‫األولى‬(Referencing relation)‫الثانية‬ ‫العالقة‬ ‫ضمن‬(Referenced relation)
■‫مثل‬:dept_name‫العالقة‬ ‫في‬ ‫خارجي‬ ‫مفتاح‬ ‫هو‬Instructor‫في‬ ‫رئيسي‬ ‫مفتاح‬ ‫يقابله‬
‫العالقة‬department
2020 By Eng. Joud Khattab
STRUCTURED QUERY
LANGUAGE (SQL)
‫االستعالم‬ ‫لغة‬
2020 By Eng. Joud Khattab
Overview
■‫المعطيات‬ ‫قواعد‬ ‫لغات‬:
–‫المعطيات‬ ‫تعريف‬ ‫لغة‬( :DDL Data Definition Language)
–‫المعطيات‬ ‫مع‬ ‫التعامل‬ ‫لغة‬( :DML Data Manipulation Language)
■‫إجرائية‬ ‫لغات‬:‫إليها‬ ‫يحتاج‬ ‫التي‬ ‫المعطيات‬ ‫تحديد‬ ‫المستثمر‬ ‫من‬ ‫تتطلب‬‫ال‬ ‫وطريقة‬‫حصول‬
‫عليها‬.
■‫إجرائية‬ ‫غير‬ ‫لغات‬:‫إليها‬ ‫يحتاج‬ ‫التي‬ ‫المعطيات‬ ‫تحديد‬ ‫المستثمر‬ ‫من‬ ‫تتطلب‬‫ت‬ ‫دون‬‫حديد‬
‫عليها‬ ‫الحصول‬ ‫كيفية‬.
2020 By Eng. Joud Khattab
Overview
2020 By Eng. Joud Khattab
Data Definition Language (DDL)
(‫المعطيات‬ ‫تعريف‬ ‫)لغة‬
■ Create a Table (‫جدول‬ ‫)بناء‬
■ Examples:
– create table instructor (
ID char(5),
name varchar(20) not null,
dept_name varchar(20),
salary numeric(8,2),
primary key (ID),
foreign key (dept_name) references department)
2020 By Eng. Joud Khattab
Data Definition Language (DDL)
(‫المعطيات‬ ‫تعريف‬ ‫)لغة‬
■ Alter & Drop Tables: (‫وحذفها‬ ‫الجداول‬ ‫)تعديل‬
■ Examples:
– alter table r add A D
– alter table r drop A
– drop table r
2020 By Eng. Joud Khattab
Data Manipulation Language (DML)
(‫المعطيات‬ ‫مع‬ ‫التعامل‬ ‫)لغة‬
■ Insert (‫)اإلدخال‬
■ Examples:
– insert into course
values (’CS-437’, ’Database Systems’, ’Comp. Sci.’, 4);
– insert into course (course_id, title, credits, dept_name)
values (’CS-437’, ’Database Systems’, 4, ’Comp. Sci.’);
– insert into student
values (’3003’, ’Green’, ’Finance’, null);
– insert into student
select ID, name, dept_name, 0
from instructor;
– insert into table1 select * from table1;
2020 By Eng. Joud Khattab
Data Manipulation Language (DML)
(‫المعطيات‬ ‫مع‬ ‫التعامل‬ ‫)لغة‬
■ Update (‫)التعديل‬
■ Examples:
– update instructor
set salary = salary * 1.03
where salary > 100000;
2020 By Eng. Joud Khattab
Data Manipulation Language (DML)
(‫المعطيات‬ ‫مع‬ ‫التعامل‬ ‫)لغة‬
■ Delete (‫)الحذف‬
– delete from instructor
– delete from instructor
where dept name in (select dept name
from department
where building = ’Watson’);
– delete from instructor
where salary < (select avg (salary) from instructor);
2020 By Eng. Joud Khattab
Select Clause
Rule
■ Rule:
select A1, A2, ..., An
from r1, r2, ..., rm
where P
■ Examples:
– select *
from instructor
– select ID, name, salary/12
from instructor
– select distinct dept_name
from instructor
2020 By Eng. Joud Khattab
Select Clause
Conditions
■ select name
from instructor
where dept_name = ‘Comp. Sci.' and salary > 80000
■ select name, course_id
from instructor, teaches
where (instructor.ID, dept_name) = (teaches.ID, ’Biology’);
2020 By Eng. Joud Khattab
Select Clause
Join (‫)الضم‬
■ select *
from instructor, teaches
■‫ديكارتي‬ ‫جداء‬ ‫يعني‬ ‫شروط‬ ‫بدون‬ ‫جدول‬ ‫من‬ ‫أكثر‬ ‫وجود‬.
■‫أخرى‬ ‫شروط‬ ‫بدون‬ ‫مفيد‬ ‫غير‬ ‫الديكارتي‬ ‫الجداء‬.
2020 By Eng. Joud Khattab
Select Clause
Join (‫)الضم‬
■‫شروط‬ ‫مع‬ ‫لكن‬ ‫ديكارتي‬ ‫جداء‬.
■‫مثال‬:
–‫أعطوها‬ ‫التي‬ ‫المواد‬ ‫أرقام‬ ‫مع‬ ً‫دروسا‬ ‫أعطوا‬ ‫الذين‬ ‫المدرسين‬ ‫أسماء‬ ‫أوجد‬
– select name, course_id
from instructor, teaches
where instructor.ID = teaches.ID
–‫النظم‬ ‫قسم‬ ‫يعطيها‬ ‫التي‬ ‫للمواد‬ ‫والسنة‬ ‫والفصل‬ ‫وعنوانها‬ ‫المادة‬ ‫رقم‬ ‫أوجد‬
‫المعلوماتية‬
– select section.course_id, title, semester, year
from section, course
where section.course_id = course.course_id and dept_name = ‘Comp. Sci.'
2020 By Eng. Joud Khattab
Select Clause
Natural Join (‫الطبيعي‬ ‫)الضم‬
■ course natural join prereq
2020 By Eng. Joud Khattab
Select Clause
Outer Join (‫الخارجي‬ ‫)الضم‬
course natural left outer join prereq
course natural right outer join prereq
course natural full outer join prereq
2020 By Eng. Joud Khattab
Select Clause
Renaming (‫التسمية‬ ‫)إعادة‬
■‫كلمة‬ ‫باستخدام‬ ‫والواصفات‬ ‫العالقات‬ ‫تسمية‬ ‫إعادة‬ ‫يمكن‬as
■ select ID, name, salary/12 as monthly_salary
from instructor
■‫النظم‬ ‫قسم‬ ‫مدرسي‬ ‫أحد‬ ‫من‬ ‫أعلى‬ ً‫راتبا‬ ‫يقبضون‬ ‫الذين‬ ‫المدرسين‬ ‫أسماء‬ ‫أوجد‬
‫المعلوماتية‬
■ select distinct T.name
from instructor as T, instructor as S
where T.salary > S.salary and S.dept_name = ‘Comp. Sci.’
2020 By Eng. Joud Khattab
Select Clause
Order (‫النتائج‬ ‫)ترتيب‬
■‫واصفات‬ ‫عدة‬ ‫أو‬ ‫واصفة‬ ‫قيم‬ ‫بحسب‬ ‫ترتيب‬.
■‫الواصفة‬ ‫بحسب‬ ‫أبجدي‬ ‫أو‬ ‫رقمي‬ ‫ترتيب‬.
■‫تصاعدي‬ ‫ترتيب‬asc‫تنازلي‬ ‫أو‬desc
■ select distinct name
from instructor
order by name
2020 By Eng. Joud Khattab
Select Clause
(‫المحارف‬ ‫سالسل‬ ‫على‬ ‫)العمليات‬
■‫العملية‬ ‫باستخدام‬ ‫تقريبية‬ ‫مطابقة‬like
–‫معدومة‬ ‫تكون‬ ‫قد‬ ‫محارف‬ ‫مجموعة‬ ‫أو‬ ‫محرف‬ ‫لمطابقة‬ ‫خاص‬ ‫محرف‬%
–‫واحد‬ ‫محرف‬ ‫لمطابقة‬ ‫خاص‬ ‫محرف‬_
■ select name
from instructor
where name like '%dar%'
■‫المحرفين‬ ‫هذين‬ ‫أحد‬ ‫يتضمن‬ ‫عنه‬ ‫نبحث‬ ‫ما‬ ‫كان‬ ‫لو‬ ‫ماذا‬
–‫عن‬ ‫نبحث‬ ً‫مثال‬ ‫كنا‬ ‫إذا‬“100%”
–‫المحرف‬ ‫عمل‬ ‫نلغي‬%‫إلغاء‬ ‫محرف‬ ‫باستخدام‬like ‘100 %' escape ''
■‫المحارف‬ ‫سالسل‬ ‫على‬ ‫أخرى‬ ‫عمليات‬
–‫الدمج‬concatenation ( “||”)
–‫والكبيرة‬ ‫الصغيرة‬ ‫األحرف‬ ‫بين‬ ‫التحويل‬upper, lower
–‫محارف‬ ‫سلسلة‬ ‫طول‬length
–‫السلسلة‬ ‫من‬ ‫معين‬ ‫مكان‬ ‫من‬ ً‫بدءا‬ ‫معين‬ ‫بطول‬ ‫جزء‬ ‫استخراج‬substring
2020 By Eng. Joud Khattab
Select Clause
Set Operations (‫المجموعات‬ ‫على‬ ‫)العمليات‬
■ (select course_id from section where sem = ‘Fall’ and year = 2009)
union
(select course_id from section where sem = ‘Spring’ and year = 2010)
■ (select course_id from section where sem = ‘Fall’ and year = 2009)
intersect
(select course_id from section where sem = ‘Spring’ and year = 2010)
■ (select course_id from section where sem = ‘Fall’ and year = 2009)
except
(select course_id from section where sem = ‘Spring’ and year = 2010)
■‫مالحظة‬:
–‫آلي‬ ‫حذف‬‫للتكرارس‬
–‫العمليات‬ ‫تستخدم‬ ‫التكرار‬ ‫إلبقاء‬union all, intersect all, except all
2020 By Eng. Joud Khattab
Select Clause
Null Values (‫المعدومة‬ ‫)القيم‬
■‫واردة‬ ‫غير‬ ‫أو‬ ‫معروفة‬ ‫غير‬ ‫أو‬ ‫موجودة‬ ‫غير‬ ‫قيمة‬
■‫القيمة‬ ‫كانت‬ ‫إذا‬ ‫نختبر‬ ‫أن‬ ‫يمكن‬null‫الشرط‬ ‫باستخدام‬is null
■ select name
from instructor
where salary is null;
■‫القيمة‬ ‫تتضمن‬ ‫رياضية‬ ‫عملية‬ ‫نتيجة‬null‫هي‬null(5 + null = null)
■ OR: (unknown or true) = true
(unknown or false) = unknown
(unknown or unknown) = unknown
■ AND: (true and unknown) = unknown
(false and unknown) = false,
(unknown and unknown) = unknown
■ NOT: (not unknown) = unknown
■‫الطرفين‬ ‫أحد‬ ‫كان‬ ‫إذا‬ ‫المقارنة‬ ‫عمليات‬ ‫في‬null‫النتيجة‬ ‫تكون‬unknown
■‫التركيب‬ ‫نتيجة‬where‫أنها‬ ‫على‬ ‫معها‬ ‫التعامل‬ ‫يجري‬false‫تساوي‬ ‫كانت‬ ‫إذا‬unknown
2020 By Eng. Joud Khattab
Select Clause
Aggregate Functions (‫التجميع‬ ‫)توابع‬
■‫واحدة‬ ‫قيمة‬ ‫وتعيد‬ ‫قيم‬ ‫مجموعة‬ ‫دخلها‬ ‫في‬ ‫تأخذ‬ ‫توابع‬
■ select avg (salary)
from instructor
where dept_name= ’Comp. Sci.’;
■ select count (*)
from course;
■ select count (distinct ID)
from teaches
where semester = ’Spring’ and year = 2010;
■‫القيمة‬ ‫التجميع‬ ‫توابع‬ ‫تجاهل‬null
avg: average value
min: minimum value
max: maximum value
sum: sum of values
count: number of values
2020 By Eng. Joud Khattab
Select Clause
Group By (‫واصفة‬ ‫بحسب‬ ‫)التجميع‬
■‫مالحظات‬:
–‫واصفة‬ ‫من‬ ‫أكثر‬ ‫على‬ ‫التجميع‬ ‫يمكن‬
–‫قائمة‬ ‫في‬ ‫التجميعي‬ ‫التابع‬ ‫خارج‬ ‫الموجودة‬ ‫الواصفات‬ ‫جميع‬ ‫تظهر‬ ‫أن‬ ‫يجب‬group by
select dept_name, avg (salary)
from instructor
group by dept_name;
2020 By Eng. Joud Khattab
Select Clause
Having ‫التجميع‬ ‫على‬ ‫الشروط‬
■‫مالحظة‬:
–‫في‬ ‫الموجود‬ ‫الشرط‬ ‫يطبق‬having‫شرط‬ ‫يطبق‬ ‫بينما‬ ‫المجموعات‬ ‫تشكيل‬ ‫بعد‬where‫تشكيلها‬ ‫قبل‬
select dept_name, avg (salary)
from instructor
group by dept_name
having avg (salary) > 42000;
2020 By Eng. Joud Khattab
Views (‫)الرؤى‬
■‫الجداول‬ ‫على‬ ‫المعقدة‬ ‫االستعالمات‬ ‫لتسهيل‬ ‫وسيلة‬.
■ً‫فعليا‬ ‫مخزنة‬ ‫غير‬ ‫افتراضية‬ ‫جداول‬.
■‫بلغة‬ ‫مكتوبة‬ ‫اسم‬ ‫ولها‬ ‫مخزنة‬ ‫استعالمات‬SQL
■‫آخر‬ ‫جدول‬ ‫كأي‬ ‫استخدامها‬ ‫يمكن‬ ‫إنشائها‬ ‫بعد‬
■‫باستخدامها‬ ‫أخرى‬ ‫رؤية‬ ‫إنشاء‬ ‫حتى‬ ‫أو‬
■ create view v as < query expression >
– create view faculty as
select ID, name, dept_name
from instructor;
– select name
from faculty
where dept_name = ‘Biology’;
– create view bio_faculty as
select *
from faculty
where dept_name = ‘Biology’;
2020 By Eng. Joud Khattab
Transaction (‫المداولة‬ ‫)مفهوم‬
■ Commit (‫تثبيت‬ ‫)تعليمات‬
■ Rollback (‫إلغاء‬ ‫)تعليمات‬
■‫تعليمات‬DDLً‫تلقائيا‬ ‫بالتثبيت‬ ‫تقوم‬.
2020 By Eng. Joud Khattab
‫أخرى‬ ‫معطيات‬ ‫أنماط‬
■ Date:
– day, month, year ‘2005-7-27’
■ Time:
– hours, minutes, seconds ‘09:00:30’, ‘09:00:30.75’
■ Timestamp:
– date + time ‘2005-7-27 09:00:30.75’
■ interval period of time:
– timestamp1- timestamp2
■ Blob:
– binary large object (image, sound, movie, …)
■ Clob:
– character large object (memo, text book, …)
2020 By Eng. Joud Khattab
Question 1
■ The attributes made up of more than one single attributes are called:
A. Derived attribute
B. Composite attribute
C. Single value attribute
D. Multi value attribute
2020 By Eng. Joud Khattab
Question 1
■ The attributes made up of more than one single attributes are called:
A. Derived attribute
B. Composite attribute
C. Single value attribute
D. Multi value attribute
2020 By Eng. Joud Khattab
Question 2
■ Operations such as “and”. The result of:
true and unknown is _____
false and unknown is _____
unknown and unknown is _____
A. Unknown, unknown, false
B. True, false, unknown
C. True, unknow, unknown
D. Unknown, false, unknown
2020 By Eng. Joud Khattab
Question 2
■ Operations such as “and”. The result of:
true and unknown is _____
false and unknown is _____
unknown and unknown is _____
A. Unknown, unknown, false
B. True, false, unknown
C. True, unknow, unknown
D. Unknown, false, unknown
2020 By Eng. Joud Khattab
Question 3
■ Using the _____ clause retains only one copy of such identical tuples.
A. Null
B. Unique
C. Not null
D. Distinct
2020 By Eng. Joud Khattab
Question 3
■ Using the _____ clause retains only one copy of such identical tuples.
A. Null
B. Unique
C. Not null
D. Distinct
2020 By Eng. Joud Khattab
Question 4
■ In an employee table to include the attributes whose “value always have some
value” which of the following constraint must be used?
A. Null
B. Not null
C. Unique
D. Distinct
2020 By Eng. Joud Khattab
Question 4
■ In an employee table to include the attributes whose “value always have some
value” which of the following constraint must be used?
A. Null
B. Not null
C. Unique
D. Distinct
2020 By Eng. Joud Khattab
Question 5
■ Aggregate functions are functions that take a _____ as input and return a single
value.
A. Collection of values
B. Single value
C. Aggregate value
D. Both collection of values & single value
2020 By Eng. Joud Khattab
Question 5
■ Aggregate functions are functions that take a _____ as input and return a single
value.
A. Collection of values
B. Single value
C. Aggregate value
D. Both collection of values & single value
2020 By Eng. Joud Khattab
Question 6
■ All aggregate functions except _____ ignore null values in their input collection.
A. Count(attribute)
B. Count(*)
C. Avg
D. Sum
2020 By Eng. Joud Khattab
Question 6
■ All aggregate functions except _____ ignore null values in their input collection.
A. Count(attribute)
B. Count(*)
C. Avg
D. Sum
2020 By Eng. Joud Khattab
Question 7
■ Aggregate functions can be used in the select list or the _____ clause of a select
statement or subquery. They cannot be used in a _____ clause.
A. Where, having
B. Having, where
C. Group by, having
D. Group by, where
2020 By Eng. Joud Khattab
Question 7
■ Aggregate functions can be used in the select list or the _____ clause of a select
statement or subquery. They cannot be used in a _____ clause.
A. Where, having
B. Having, where
C. Group by, having
D. Group by, where
2020 By Eng. Joud Khattab
Question 8
■ Which of the following deletes all the entries but keeps the structure of the relation.
A. Delete from r where P;
B. Delete from instructor where dept name = ‘Finance’;
C. Delete from instructor where salary between 13000 and 15000;
D. Delete from instructor;
2020 By Eng. Joud Khattab
Question 8
■ Which of the following deletes all the entries but keeps the structure of the relation.
A. Delete from r where P;
B. Delete from instructor where dept name = ‘Finance’;
C. Delete from instructor where salary between 13000 and 15000;
D. Delete from instructor;
2020 By Eng. Joud Khattab
Question 9
■ Fill in with correct keyword to update the instructor relation
Update instructor _____ salary = salary * 1.05;
A. Where
B. Set
C. In
D. select
2020 By Eng. Joud Khattab
Question 9
■ Fill in with correct keyword to update the instructor relation
Update instructor _____ salary = salary * 1.05;
A. Where
B. Set
C. In
D. select
2020 By Eng. Joud Khattab
Question 10
■ Which of the join operations do not preserve non matched tuples?
A. Left outer join
B. Right outer join
C. Inner join
D. Natural join
2020 By Eng. Joud Khattab
Question 10
■ Which of the join operations do not preserve non matched tuples?
A. Left outer join
B. Right outer join
C. Inner join
D. Natural join
2020 By Eng. Joud Khattab
Question 11
■ How many tables may be included with a join?
A. One
B. Two
C. Three
D. All of the mentioned
2020 By Eng. Joud Khattab
Question 11
■ How many tables may be included with a join?
A. One
B. Two
C. Three
D. All of the mentioned
2020 By Eng. Joud Khattab
Question 12
■ Data integrity constraints are used to:
A. Control who is allowed access to the data
B. Ensure that duplicate records are not entered into the table
C. Improve the quality of data entered for a specific property
D. Prevent users from changing the values stored in the table
2020 By Eng. Joud Khattab
Question 12
■ Data integrity constraints are used to:
A. Control who is allowed access to the data
B. Ensure that duplicate records are not entered into the table
C. Improve the quality of data entered for a specific property
D. Prevent users from changing the values stored in the table
2020 By Eng. Joud Khattab
Question 13
■ In order to ensure that an instructor’s salary domain allows only values greater than
a specified value use:
A. Value >= 30000.00
B. Not null;
C. Check(value >= 29000.00);
D. Check(value)
2020 By Eng. Joud Khattab
Question 13
■ In order to ensure that an instructor’s salary domain allows only values greater than
a specified value use:
A. Value >= 30000.00
B. Not null;
C. Check(value >= 29000.00);
D. Check(value)
2020 By Eng. Joud Khattab
Question 14
■ Which of the following statement is used to remove the privilege from the user Amir?
A. Remove update on department from Amir
B. Revoke update on employee from Amir
C. Delete select on department from Raj
D. Grant update on employee from Amir
2020 By Eng. Joud Khattab
Question 14
■ Which of the following statement is used to remove the privilege from the user Amir?
A. Remove update on department from Amir
B. Revoke update on employee from Amir
C. Delete select on department from Raj
D. Grant update on employee from Amir
2020 By Eng. Joud Khattab
Question 15
■ Which of the following is another name for a weak entity?
A. Child
B. Owner
C. Dominant
D. All of the mentioned
2020 By Eng. Joud Khattab
Question 15
■ Which of the following is another name for a weak entity?
A. Child
B. Owner
C. Dominant
D. All of the mentioned
2020 By Eng. Joud Khattab
Question 16
■ E-R model uses which symbol to represent weak entity set:
A. Dotted rectangle
B. Diamond
C. Doubly outlined rectangle
D. None of the above
2020 By Eng. Joud Khattab
Question 16
■ E-R model uses which symbol to represent weak entity set:
A. Dotted rectangle
B. Diamond
C. Doubly outlined rectangle
D. None of the above
2020 By Eng. Joud Khattab
XML
2020 By Eng. Joud Khattab
XML
■ Structure
– Elements and Attributes
– Namespaces
– DTD
– XML Schema
■ Query
– XPath
– XQuery (FLOWER)
– XSLT
2020 By Eng. Joud Khattab
XML Introduction
■ XML (eXtensible Markup Language)
■ semi-structured data models.
■ Derived from SGML (Standard Generalized Markup Language)
■ Documents have tags giving extra information about sections of the document
– <title> XML </title> <slide> Introduction …</slide>
■ Extensible, unlike HTML Users can add new tags.
■ The ability to specify new tags, and to create nested tag structures make XML a
great way to exchange data, not just documents.
■ Elements must be properly nested
2020 By Eng. Joud Khattab
XML Namespaces
■ Usage:
– XML data has to be exchanged between organizations.
– Same tag name may have different meaning in different organizations, causing confusion on
exchanged documents.
■ Example:
<university xmlns:yale=“http://www.yale.edu”>
…
<yale:course>
<yale:course_id> CS-101 </yale:course_id>
<yale:title> Intro. to Computer Science</yale:title>
<yale:dept_name> Comp. Sci. </yale:dept_name>
<yale:credits> 4 </yale:credits>
</yale:course>
…
</university>
2020 By Eng. Joud Khattab
XML (DTD)
Document Type Definition
■ The type of an XML document can be specified using a DTD
■ DTD constraints structure of XML data
– What elements can occur
– What attributes can/must an element have
– What subelements can/must occur inside each element, and how many times.
■ DTD does not constrain data types
– All values represented as strings in XML
■ DTD syntax
– <!ELEMENT element (subelements-specification) >
– <!ATTLIST element (attributes) >
2020 By Eng. Joud Khattab
XML Schema
■ XML Schema is a more sophisticated schema language which addresses the
drawbacks of DTDs.
■ Supports:
– Typing of values
■ integer, string, etc
■ constraints on min/max values
– User-defined, complex types
– Many more features, including
■ uniqueness and foreign key constraints, inheritance
2020 By Eng. Joud Khattab
XML XPath
■ XPath is used to address (select) parts of documents using path expressions
■ A path expression is a sequence of steps separated by “/”
■ Examples:
– /university-3/instructor/name
■ <name>Srinivasan</name>
■ <name>Brandt</name>
– /university-3/instructor/name/text( )
■ returns the same names, but without the enclosing tags
– /university-3/course[credits >= 4]
■ returns course elements with a credit value greater or equal 4
– /university-3/course[credits >= 4]/@course_id
■ returns the course identifiers of courses with credits >= 4
2020 By Eng. Joud Khattab
XML XQuery
■ XQuery is a general purpose query language for XML data
■ XQuery uses a
for … let … where … order by … return…
■ Syntax
– For <--> SQL from
– Where <--> SQL where
– order by <--> SQL order by
– return <--> SQL select
– let allows temporary variables, and has no equivalent in SQL
2020 By Eng. Joud Khattab
XML XQuery
FLWOR Syntax
■ Examples:
– find all courses with credits > 3, with each result enclosed in an <course_id> ..
</course_id> tag
for $x in /university-3/course
let $courseId := $x/@course_id
where $x/credits > 3
return <course_id> { $courseId } </course id>
■ Items in the return clause are XML text unless enclosed in {}, in which case they are
evaluated
2020 By Eng. Joud Khattab
Question 1
■ What does XML stand for?
A. eXtra Modern Link
B. eXtensible Markup Language
C. Example Markup Language
D. X-Markup Language
2020 By Eng. Joud Khattab
Question 1
■ What does XML stand for?
A. eXtra Modern Link
B. eXtensible Markup Language
C. Example Markup Language
D. X-Markup Language
2020 By Eng. Joud Khattab
Question 2
■ What is the correct syntax of the declaration which defines the XML version?
A. <xml version=“1.0”/>
B. <?xml version=“1.0”?>
C. <?xml version=“1.0”/>
D. None of the above
2020 By Eng. Joud Khattab
Question 2
■ What is the correct syntax of the declaration which defines the XML version?
A. <xml version=“1.0”/>
B. <?xml version=“1.0”?>
C. <?xml version=“1.0”/>
D. None of the above
2020 By Eng. Joud Khattab
Question 3
■ Is it easier to process XML than HTML?
A. Yes
B. No
C. Sometimes
D. Cant say
2020 By Eng. Joud Khattab
Question 3
■ Is it easier to process XML than HTML?
A. Yes
B. No
C. Sometimes
D. Cant say
2020 By Eng. Joud Khattab
Question 4
■ Kind of Parsers are
A. Well-formed
B. Well-documented
C. Non-validating and validating
D. None of the above
2020 By Eng. Joud Khattab
Question 4
■ Kind of Parsers are
A. Well-formed
B. Well-documented
C. Non-validating and validating
D. None of the above
2020 By Eng. Joud Khattab
Question 5
■ Well formed XML document means
A. It contains a root element
B. It contain an element
C. It contains one or more elements
D. Must contain one or more elements and root element must contain all other
elements
2020 By Eng. Joud Khattab
Question 5
■ Well formed XML document means
A. It contains a root element
B. It contain an element
C. It contains one or more elements
D. Must contain one or more elements and root element must contain all other
elements
2020 By Eng. Joud Khattab
Question 6
■ Comment in XML document is given by
A. <?-- -->
B. <!-- --!>
C. <!-- -->
D. </-- -->
2020 By Eng. Joud Khattab
Question 6
■ Comment in XML document is given by
A. <?-- -->
B. <!-- --!>
C. <!-- -->
D. </-- -->
2020 By Eng. Joud Khattab
Question 7
■ XML uses the features of
A. HTML
B. XHTML
C. VML
D. SGML
2020 By Eng. Joud Khattab
Question 7
■ XML uses the features of
A. HTML
B. XHTML
C. VML
D. SGML
2020 By Eng. Joud Khattab
Question 8
■ What does DTD stand for?
A. Direct Type Definition
B. Document Type Definition
C. Dynamic Type Definition
2020 By Eng. Joud Khattab
Question 8
■ What does DTD stand for?
A. Direct Type Definition
B. Document Type Definition
C. Dynamic Type Definition
2020 By Eng. Joud Khattab
Question 9
■ Which of the following XML fragments are well-formed?
A. <myElement myAttribute=“someValue”/>
B. <myElement myAttribute=someValue/>
C. <myElement myAttribute=‘someValue’/>
D. <myElement myAttribute=“someValue’/>
2020 By Eng. Joud Khattab
Question 9
■ Which of the following XML fragments are well-formed?
A. <myElement myAttribute=“someValue”/>
B. <myElement myAttribute=someValue/>
C. <myElement myAttribute=‘someValue’/>
D. <myElement myAttribute=“someValue’/>
2020 By Eng. Joud Khattab
Question 10
■ How can we make attributes have multiple values:
A. <myElement myAttribute=“value1 value2”/>
B. <myElement myAttribute=“value1” myAttribute=“value2”/>
C. <myElement myAttribute=“value1,value2”/>
D. Attributes cannot have multiple values
2020 By Eng. Joud Khattab
Question 10
■ How can we make attributes have multiple values:
A. <myElement myAttribute=“value1 value2”/>
B. <myElement myAttribute=“value1” myAttribute=“value2”/>
C. <myElement myAttribute=“value1,value2”/>
D. Attributes cannot have multiple values
2020 By Eng. Joud Khattab
Question 11
■ In XML
A. The internal DTD subset is read before the external DTD
B. The external DTD subset is read before the internal DTD
C. There is no external type of DTD
D. There is no internal type of DTD
2020 By Eng. Joud Khattab
Question 11
■ In XML
A. The internal DTD subset is read before the external DTD
B. The external DTD subset is read before the internal DTD
C. There is no external type of DTD
D. There is no internal type of DTD
2020 By Eng. Joud Khattab
Question 12
■ Is this a “well formed” XML document?
<?xml version=“1.0”?>
<note>
<to age=29>Tove</to>
<from>Jani</from>
</note>
A. True
B. False
2020 By Eng. Joud Khattab
Question 12
■ Is this a “well formed” XML document?
<?xml version=“1.0”?>
<note>
<to age=29>Tove</to>
<from>Jani</from>
</note>
A. True
B. False
2020 By Eng. Joud Khattab
Question 13
■ XML preserves white spaces
A. True
B. False
2020 By Eng. Joud Khattab
Question 13
■ XML preserves white spaces
A. True
B. False
2020 By Eng. Joud Khattab
NORMALIZATION
2020 By Eng. Joud Khattab
Normalization Process
1NF
2NF
3NF
3.5NF
4NF
2020 By Eng. Joud Khattab
Normalization Process
■ Every table in your Database should at least follow the 1st Normal Form, always.
■ Or stop using Database!!
2020 By Eng. Joud Khattab
1st Normal Form
■ There are 4 basic rules that a table should follow to be in 1st Normal Form.
2020 By Eng. Joud Khattab
1st Normal Form
Rule 1
■ Each column should contain atomic
values.
■ Entries like X,Y and W,X violate this
rule.
2020 By Eng. Joud Khattab
1st Normal Form
Rule 2
■ A column should contain values that
are of the same type.
■ Do not inter-mix different types of
values in any column.
2020 By Eng. Joud Khattab
1st Normal Form
Rule 3
■ Each column should have a unique
name.
■ Same names leads to confusion at the
time of data retrieval.
2020 By Eng. Joud Khattab
1st Normal Form
Rule 4
■ Order in which data is saved doesn’t
matter.
■ Using SQL query. You can easily fetch
data in any order from a table.
2020 By Eng. Joud Khattab
1st Normal Form
Example
2020 By Eng. Joud Khattab
1st Normal Form
Example
2020 By Eng. Joud Khattab
1st Normal Form
Example
2020 By Eng. Joud Khattab
2nd Normal Form
■ For a table to be in the Second Normal Form:
– It should be in 1st Normal Form.
– And, it should not have any Partial Dependencies.
2020 By Eng. Joud Khattab
2nd Normal Form
What is Partial Dependency?
■ To understand Partial Dependency.
■ We first need to understand what Dependency is?
2020 By Eng. Joud Khattab
2nd Normal Form
What is Partial Dependency?
2020 By Eng. Joud Khattab
2nd Normal Form
What is Partial Dependency?
2020 By Eng. Joud Khattab
2nd Normal Form
What is Partial Dependency?
■ Primary Key should be score_id
■ But student_id + subject_id together makes a more meaningful primary key.
2020 By Eng. Joud Khattab
2nd Normal Form
What is Partial Dependency?
2020 By Eng. Joud Khattab
2nd Normal Form
What is Partial Dependency?
2020 By Eng. Joud Khattab
2nd Normal Form
This is Partial Dependency
Teacher column only
depends on subject
and not on student.
2020 By Eng. Joud Khattab
2nd Normal Form
This is Partial Dependency
Move teacher column to Subject table
2020 By Eng. Joud Khattab
2nd Normal Form
This is Partial Dependency
2020 By Eng. Joud Khattab
2nd Normal Form
This is Partial Dependency
2020 By Eng. Joud Khattab
2nd Normal Form
2020 By Eng. Joud Khattab
3rd Normal Form
2020 By Eng. Joud Khattab
3rd Normal Form
■ For a table to be in 3rd Normal Form:
– It should be in 2nd Normal Form.
– And it should not have Transitive Dependency.
2020 By Eng. Joud Khattab
3rd Normal Form
2020 By Eng. Joud Khattab
3rd Normal Form
2020 By Eng. Joud Khattab
3rd Normal Form
2020 By Eng. Joud Khattab
3.5 Normal Form (BCNF)
Boyce-Codd Normal Form
■ Tables should satisfy 2 conditions:
– It should be in the 3rd Normal Form.
– For any dependency A → B, A should be a super key.
2020 By Eng. Joud Khattab
3.5 Normal Form (BCNF)
Boyce-Codd Normal Form
2020 By Eng. Joud Khattab
3.5 Normal Form (BCNF)
Boyce-Codd Normal Form
2020 By Eng. Joud Khattab
3.5 Normal Form (BCNF)
Boyce-Codd Normal Form
2020 By Eng. Joud Khattab
4th Normal Form
■ It should satisfy BCNF.
■ It should not have Multi-Valued Dependency.
2020 By Eng. Joud Khattab
4th Normal Form
2020 By Eng. Joud Khattab
4th Normal Form
2020 By Eng. Joud Khattab
4th Normal Form
2 independent tables
2020 By Eng. Joud Khattab
Question 1
■ In the _____ normal form, a composite attribute is converted to individual attributes.
A. First
B. Second
C. Third
D. Fourth
2020 By Eng. Joud Khattab
Question 1
■ In the _____ normal form, a composite attribute is converted to individual attributes.
A. First
B. Second
C. Third
D. Fourth
2020 By Eng. Joud Khattab
Question 2
■ Tables in second normal form (2NF)
A. Eliminate all hidden dependencies
B. Eliminate the possibility of a insertion anomalies
C. Have a composite key
D. Have all non key fields depend on the whole primary key
2020 By Eng. Joud Khattab
Question 2
■ Tables in second normal form (2NF)
A. Eliminate all hidden dependencies
B. Eliminate the possibility of a insertion anomalies
C. Have a composite key
D. Have all non key fields depend on the whole primary key
2020 By Eng. Joud Khattab
Question 3
■ Which forms are based on the concept of functional dependency
A. 1NF
B. 2NF
C. 3NF
D. 4NF
2020 By Eng. Joud Khattab
Question 3
■ Which forms are based on the concept of functional dependency
A. 1NF
B. 2NF
C. 3NF
D. 4NF
2020 By Eng. Joud Khattab
RATIONAL ALGEBRA
2020 By Eng. Joud Khattab
Question 1
■ If E1 and E2 are relational algebra expressions, then which of the following is NOT a
relational algebra expression?
A. E1 ∪ E2
B. E1 / E2
C. E1 – E2
D. E1 x E2
2020 By Eng. Joud Khattab
Question 1
■ If E1 and E2 are relational algebra expressions, then which of the following is NOT a
relational algebra expression?
A. E1 ∪ E2
B. E1 / E2
C. E1 – E2
D. E1 x E2
2020 By Eng. Joud Khattab
Question 2
■ Which clause from the following corresponds to the projection operation of the
relational algebra?
A. From
B. Select
C. Where
D. Group by
2020 By Eng. Joud Khattab
Question 2
■ Which clause from the following corresponds to the projection operation of the
relational algebra?
A. From
B. Select
C. Where
D. Group by
2020 By Eng. Joud Khattab
MCQ
2020 By Eng. Joud Khattab
Question 1
■ A relational database consists of a collection of
A. Tables
B. Fields
C. Records
D. Keys
2020 By Eng. Joud Khattab
Question 1
■ A relational database consists of a collection of
A. Tables
B. Fields
C. Records
D. Keys
2020 By Eng. Joud Khattab
Question 2
■ The term _______ is used to refer to a row.
A. Attribute
B. Tuple
C. Field
D. Instance
2020 By Eng. Joud Khattab
Question 2
■ The term _______ is used to refer to a row.
A. Attribute
B. Tuple
C. Field
D. Instance
2020 By Eng. Joud Khattab
Question 3
■ The term attribute refers to a ___________ of a table.
A. Record
B. Column
C. Tuple
D. Key
2020 By Eng. Joud Khattab
Question 3
■ The term attribute refers to a ___________ of a table.
A. Record
B. Column
C. Tuple
D. Key
2020 By Eng. Joud Khattab
Question 4
■ Database __________ which is the logical design of the database, and the database
_______ which is a snapshot of the data in the database at a given instant in time.
A. Instance, Schema
B. Relation, Schema
C. Relation, Domain
D. Schema, Instance
2020 By Eng. Joud Khattab
Question 4
■ Database __________ which is the logical design of the database, and the database
_______ which is a snapshot of the data in the database at a given instant in time.
A. Instance, Schema
B. Relation, Schema
C. Relation, Domain
D. Schema, Instance
2020 By Eng. Joud Khattab
Question 5
■ Course (course_id,sec_id,semester)
Here the course_id,sec_id and semester are __________ and course is a _________
A. Relations, Attribute
B. Attributes, Relation
C. Tuple, Relation
D. Tuple, Attributes
2020 By Eng. Joud Khattab
Question 5
■ Course (course_id,sec_id,semester)
Here the course_id,sec_id and semester are __________ and course is a _________
A. Relations, Attribute
B. Attributes, Relation
C. Tuple, Relation
D. Tuple, Attributes
2020 By Eng. Joud Khattab
Question 6
■ The tuples of the relations can be of ________ order
A. Any
B. Same
C. Sorted
D. Constant
2020 By Eng. Joud Khattab
Question 6
■ The tuples of the relations can be of ________ order
A. Any
B. Same
C. Sorted
D. Constant
2020 By Eng. Joud Khattab
Question 7
■ Which one of the following attribute can be taken as a primary key ?
A. Name
B. Street
C. Id
D. Department
2020 By Eng. Joud Khattab
Question 7
■ Which one of the following attribute can be taken as a primary key ?
A. Name
B. Street
C. Id
D. Department
2020 By Eng. Joud Khattab
Question 8
■ The ______ is the one in which the primary key of one relation is used as a normal
attribute in another relation.
A. Referential relation
B. Referencing relation
C. Referenced relation
D. Referred relation
2020 By Eng. Joud Khattab
Question 8
■ The ______ is the one in which the primary key of one relation is used as a normal
attribute in another relation.
A. Referential relation
B. Referencing relation
C. Referenced relation
D. Referred relation
2020 By Eng. Joud Khattab
Question 9
■ The _____ operation allows the combining of two relations by merging pairs of
tuples, one from each relation, into a single tuple
A. Select
B. Join
C. Union
D. Intersection
2020 By Eng. Joud Khattab
Question 9
■ The _____ operation allows the combining of two relations by merging pairs of
tuples, one from each relation, into a single tuple
A. Select
B. Join
C. Union
D. Intersection
2020 By Eng. Joud Khattab
Question 10
■ The result which operation contains all pairs of tuples from the two relations,
regardless of whether their attribute values match
A. Join
B. Cartesian product
C. Intersection
D. Set difference
2020 By Eng. Joud Khattab
Question 10
■ The result which operation contains all pairs of tuples from the two relations,
regardless of whether their attribute values match
A. Join
B. Cartesian product
C. Intersection
D. Set difference
2020 By Eng. Joud Khattab
Question 11
■ The _______ operation performs a set union of two “similarly structured” tables
A. Union
B. Join
C. Product
D. Intersect
2020 By Eng. Joud Khattab
Question 11
■ The _______ operation performs a set union of two “similarly structured” tables
A. Union
B. Join
C. Product
D. Intersect
2020 By Eng. Joud Khattab
Question 12
■ The _______ operator takes the results of two queries and returns only rows that
appear in both result sets
A. Union
B. Intersect
C. Difference
D. Projection
2020 By Eng. Joud Khattab
Question 12
■ The _______ operator takes the results of two queries and returns only rows that
appear in both result sets
A. Union
B. Intersect
C. Difference
D. Projection
2020 By Eng. Joud Khattab
Question 13
■ Which one of the following is used to define the structure of the relation ,deleting
relations and relating schemas ?
A. DML (Data Manipulation Language)
B. DDL (Data Definition Language)
C. Query
D. Relational Schema
2020 By Eng. Joud Khattab
Question 13
■ Which one of the following is used to define the structure of the relation ,deleting
relations and relating schemas ?
A. DML (Data Manipulation Language)
B. DDL (Data Definition Language)
C. Query
D. Relational Schema
2020 By Eng. Joud Khattab
Question 14
■ Which one of the following provides the ability to query information from the
database and to insert tuples into, delete tuples from, and modify tuples in the
database ?
A. DML (Data Manipulation Language)
B. DDL (Data Definition Language)
C. Query
D. Relational Schema
2020 By Eng. Joud Khattab
Question 14
■ Which one of the following provides the ability to query information from the
database and to insert tuples into, delete tuples from, and modify tuples in the
database ?
A. DML (Data Manipulation Language)
B. DDL (Data Definition Language)
C. Query
D. Relational Schema
2020 By Eng. Joud Khattab
Question 15
■ The basic data type char(n) is a _____ length character string and varchar(n) is
_____ length character.
A. Fixed, equal
B. Equal, variable
C. Fixed, variable
D. Variable, equal
2020 By Eng. Joud Khattab
Question 15
■ The basic data type char(n) is a _____ length character string and varchar(n) is
_____ length character.
A. Fixed, equal
B. Equal, variable
C. Fixed, variable
D. Variable, equal
2020 By Eng. Joud Khattab
Question 16
■ Insert into instructor values (10211, ’Smith’, ’Biology’, 66000);
What type of statement is this ?
A. Query
B. DML
C. Relational
D. DDL
2020 By Eng. Joud Khattab
Question 16
■ Insert into instructor values (10211, ’Smith’, ’Biology’, 66000);
What type of statement is this ?
A. Query
B. DML
C. Relational
D. DDL
2020 By Eng. Joud Khattab
Question 17
■ Select ________ dept_name
from instructor;
Here which of the following displays the unique values of the column ?
A. All
B. From
C. Distinct
D. Name
2020 By Eng. Joud Khattab
Question 17
■ Select ________ dept_name
from instructor;
Here which of the following displays the unique values of the column ?
A. All
B. From
C. Distinct
D. Name
2020 By Eng. Joud Khattab
Question 18
■ The ______ clause allows us to select only those rows in the result relation of the
____ clause that satisfy a specified predicate
A. Where, from
B. From, select
C. Select, from
D. From, where
2020 By Eng. Joud Khattab
Question 18
■ The ______ clause allows us to select only those rows in the result relation of the
____ clause that satisfy a specified predicate
A. Where, from
B. From, select
C. Select, from
D. From, where
2020 By Eng. Joud Khattab
Question 19
■ Which of the following statements contains an error?
A. Select * from emp where emp id = 10003;
B. Select empid from emp where lastname = GELLER;
C. Select emp id from emp;
D. Select empid where empid = 1009 and lastname = ‘GELLER’;
2020 By Eng. Joud Khattab
Question 19
■ Which of the following statements contains an error?
A. Select * from emp where emp id = 10003;
B. Select empid from emp where lastname = GELLER;
C. Select emp id from emp;
D. Select empid where empid = 1009 and lastname = ‘GELLER’;
2020 By Eng. Joud Khattab
Question 20
■ Which keyword must be used here to rename the field name ?
A. From
B. Rename
C. As
D. Join
2020 By Eng. Joud Khattab
Question 20
■ Which keyword must be used here to rename the field name ?
A. From
B. Rename
C. As
D. Join
2020 By Eng. Joud Khattab
Question 21
■ SELECT * FROM employee WHERE dept_name="Comp Sci";
■ In the SQL given above there is an error . Identify the error
A. Dept_name
B. Employee
C. “Comp Sci”
D. From
2020 By Eng. Joud Khattab
Question 21
■ SELECT * FROM employee WHERE dept_name="Comp Sci";
■ In the SQL given above there is an error . Identify the error
A. Dept_name
B. Employee
C. “Comp Sci”
D. From
2020 By Eng. Joud Khattab
Question 22
■ SELECT emp_name FROM department
■ WHERE dept_name LIKE ’ __ Computer Science’;
■ Which one of the following has to be added into the blank to select the dept_name
which has Computer Science as its ending string ?
A. %
B. _
C. ||
D. $
2020 By Eng. Joud Khattab
Question 22
■ SELECT emp_name FROM department
■ WHERE dept_name LIKE ’ __ Computer Science’;
■ Which one of the following has to be added into the blank to select the dept_name
which has Computer Science as its ending string ?
A. %
B. _
C. ||
D. $
2020 By Eng. Joud Khattab
Question 23
■ ’_ _ _ ’ matches any string of ______ three characters.
■ ’_ _ _ %’ matches any string of ______ three characters.
A. At least, Exactly
B. Exactly, At least
C. At least, All
D. All, Exactly
2020 By Eng. Joud Khattab
Question 23
■ ’_ _ _ ’ matches any string of ______ three characters.
■ ’_ _ _ %’ matches any string of ______ three characters.
A. At least, Exactly
B. Exactly, At least
C. At least, All
D. All, Exactly
2020 By Eng. Joud Khattab
Question 24
■ By default, the order by clause lists items in ______ order.
A. Descending
B. Any
C. Same
D. Ascending
2020 By Eng. Joud Khattab
Question 24
■ By default, the order by clause lists items in ______ order.
A. Descending
B. Any
C. Same
D. Ascending
2020 By Eng. Joud Khattab
Question 25
■ To display the salary from greater to smaller and name in ascending order which of
the following options should be used?
A. Ascending, Descending
B. Asc, Desc
C. Desc, Asc
D. Descending, Ascending
2020 By Eng. Joud Khattab
Question 25
■ To display the salary from greater to smaller and name in ascending order which of
the following options should be used?
A. Ascending, Descending
B. Asc, Desc
C. Desc, Asc
D. Descending, Ascending
2020 By Eng. Joud Khattab
Question 26
■ SELECT instructor.*
■ FROM instructor, teaches
■ WHERE instructor.ID= teaches.ID;
■ This query does which of the following operation?
A. All attributes of instructor and teaches are selected
B. All attributes of instructor are selected on the given condition
C. All attributes of teaches are selected on given condition
D. Only the some attributes from instructed and teaches are selected
2020 By Eng. Joud Khattab
Question 26
■ SELECT instructor.*
■ FROM instructor, teaches
■ WHERE instructor.ID= teaches.ID;
■ This query does which of the following operation?
A. All attributes of instructor and teaches are selected
B. All attributes of instructor are selected on the given condition
C. All attributes of teaches are selected on given condition
D. Only the some attributes from instructed and teaches are selected
2020 By Eng. Joud Khattab
Question 27
■ In SQL the spaces at the end of the string are removed by _______ function
A. Upper
B. String
C. Trim
D. Lower
2020 By Eng. Joud Khattab
Question 27
■ In SQL the spaces at the end of the string are removed by _______ function
A. Upper
B. String
C. Trim
D. Lower
2020 By Eng. Joud Khattab
Question 28
■ _____ operator is used for appending two strings
A. &
B. %
C. ||
D. _
2020 By Eng. Joud Khattab
Question 28
■ _____ operator is used for appending two strings
A. &
B. %
C. ||
D. _
2020 By Eng. Joud Khattab
Question 29
■ The union operation automatically __________ unlike the select clause
A. Adds tuples
B. Eliminates unique tuples
C. Adds common tuples
D. Eliminates duplicate
2020 By Eng. Joud Khattab
Question 29
■ The union operation automatically __________ unlike the select clause.
A. Adds tuples
B. Eliminates unique tuples
C. Adds common tuples
D. Eliminates duplicate
2020 By Eng. Joud Khattab
Question 30
■ The predicate in a where clause can involve Boolean operations such as and
■ The result of: true and unknown is _____
false and unknown is _____
unknown and unknown is _____
A. Unknown, unknown, false
B. True, false, unknown
C. True, unknown, unknown
D. Unknown, false, unknown
2020 By Eng. Joud Khattab
Question 30
■ The predicate in a where clause can involve Boolean operations such as and
■ The result of: true and unknown is _____
false and unknown is _____
unknown and unknown is _____
A. Unknown, unknown, false
B. True, false, unknown
C. True, unknown, unknown
D. Unknown, false, unknown
2020 By Eng. Joud Khattab
Question 31
■ Using the ______ clause retains only one copy of such identical tuples
A. Null
B. Unique
C. Not null
D. Distinct
2020 By Eng. Joud Khattab
Question 31
■ Using the ______ clause retains only one copy of such identical tuples
A. Null
B. Unique
C. Not null
D. Distinct
2020 By Eng. Joud Khattab
Question 32
■ In an employee table to include the attributes whose value always have some value
which of the following constraint must be used?
A. Null
B. Not null
C. Unique
D. Distinct
2020 By Eng. Joud Khattab
Question 32
■ In an employee table to include the attributes whose value always have some value
which of the following constraint must be used?
A. Null
B. Not null
C. Unique
D. Distinct
2020 By Eng. Joud Khattab
Question 33
■ Aggregate functions are functions that take a ___________ as input and return a
single value
A. Collection of values
B. Single value
C. Aggregate value
D. Both Collection of values & Single value
2020 By Eng. Joud Khattab
Question 33
■ Aggregate functions are functions that take a ___________ as input and return a
single value
A. Collection of values
B. Single value
C. Aggregate value
D. Both Collection of values & Single value
2020 By Eng. Joud Khattab
Question 34
■ All aggregate functions except _____ ignore null values in their input collection.
A. Count(attribute)
B. Count(*)
C. Avg
D. Sum
2020 By Eng. Joud Khattab
Question 34
■ All aggregate functions except _____ ignore null values in their input collection.
A. Count(attribute)
B. Count(*)
C. Avg
D. Sum
2020 By Eng. Joud Khattab
Question 35
■ Aggregate functions can be used in the select list or the _______ clause of a select
statement or subquery. They cannot be used in a ______ clause.
A. Where, having
B. Having, where
C. Group by, having
D. Group by, where
2020 By Eng. Joud Khattab
Question 35
■ Aggregate functions can be used in the select list or the _______ clause of a select
statement or subquery. They cannot be used in a ______ clause.
A. Where, having
B. Having, where
C. Group by, having
D. Group by, where
2020 By Eng. Joud Khattab
Question 36
■ Which one of the following deletes all the entries but keeps the structure of the
relation.
A. Delete from r where P;
B. Delete from instructor where dept name= ’Finance’;
C. Delete from instructor where salary between 13000 and 15000;
D. Delete from instructor;
2020 By Eng. Joud Khattab
Question 36
■ Which one of the following deletes all the entries but keeps the structure of the
relation.
A. Delete from r where P;
B. Delete from instructor where dept name= ’Finance’;
C. Delete from instructor where salary between 13000 and 15000;
D. Delete from instructor;
2020 By Eng. Joud Khattab
Question 37
■ UPDATE instructor _____ salary= salary * 1.05;
■ Fill in with correct keyword to update the instructor relation.
A. Where
B. Set
C. In
D. Select
2020 By Eng. Joud Khattab
Question 37
■ UPDATE instructor _____ salary= salary * 1.05;
■ Fill in with correct keyword to update the instructor relation.
A. Where
B. Set
C. In
D. Select
2020 By Eng. Joud Khattab
Question 38
■ Which of the join operations do not preserve non matched tuples?
A. Left outer join
B. Right outer join
C. Inner join
D. Natural join
2020 By Eng. Joud Khattab
Question 38
■ Which of the join operations do not preserve non matched tuples?
A. Left outer join
B. Right outer join
C. Inner join
D. Natural join
2020 By Eng. Joud Khattab
Question 39
■ How many tables may be included with a join?
A. One
B. Two
C. Three
D. All of the mentioned
2020 By Eng. Joud Khattab
Question 39
■ How many tables may be included with a join?
A. One
B. Two
C. Three
D. All of the mentioned
2020 By Eng. Joud Khattab
Question 40
■ Data integrity constraints are used to:
A. Control who is allowed access to the data
B. Ensure that duplicate records are not entered into the table
C. Improve the quality of data entered for a specific property
D. Prevent users from changing the values stored in the table
2020 By Eng. Joud Khattab
Question 40
■ Data integrity constraints are used to:
A. Control who is allowed access to the data
B. Ensure that duplicate records are not entered into the table
C. Improve the quality of data entered for a specific property
D. Prevent users from changing the values stored in the table
2020 By Eng. Joud Khattab
Question 41
■ In order to ensure that an instructor’s salary domain allows only values greater than
a specified value use:
A. Value>=30000.00
B. Not null;
C. Check(value >= 29000.00);
D. Check(value)
2020 By Eng. Joud Khattab
Question 41
■ In order to ensure that an instructor’s salary domain allows only values greater than
a specified value use:
A. Value>=30000.00
B. Not null;
C. Check(value >= 29000.00);
D. Check(value)
2020 By Eng. Joud Khattab
Question 42
■ Which of the following statement is used to remove the privilege from the user Amir?
A. Remove update on department from Amir
B. Revoke update on employee from Amir
C. Delete select on department from Raj
D. Grant update on employee from Amir
2020 By Eng. Joud Khattab
Question 42
■ Which of the following statement is used to remove the privilege from the user Amir?
A. Remove update on department from Amir
B. Revoke update on employee from Amir
C. Delete select on department from Raj
D. Grant update on employee from Amir
2020 By Eng. Joud Khattab
Question 43
■ Which of the following is another name for a weak entity?
A. Child
B. Owner
C. Dominant
D. All of the mentioned
2020 By Eng. Joud Khattab
Question 43
■ Which of the following is another name for a weak entity?
A. Child
B. Owner
C. Dominant
D. All of the mentioned
2020 By Eng. Joud Khattab
Question 44
■ In the __________ normal form, a composite attribute is converted to individual
attributes.
A. First
B. Second
C. Third
D. Fourth
2020 By Eng. Joud Khattab
Question 44
■ In the __________ normal form, a composite attribute is converted to individual
attributes.
A. First
B. Second
C. Third
D. Fourth
2020 By Eng. Joud Khattab
Question 45
■ The syntax of a user query is verified by:
A. Query optimizer
B. DBA
C. Parser
D. None of the above
2020 By Eng. Joud Khattab
Question 45
■ The syntax of a user query is verified by:
A. Query optimizer
B. DBA
C. Parser
D. None of the above
2020 By Eng. Joud Khattab
Question 46
■ DBA stands for:
A. Data Bank Access.
B. Database Access.
C. Data Bank Administration.
D. Database Administrator.
2020 By Eng. Joud Khattab
Question 46
■ DBA stands for:
A. Data Bank Access.
B. Database Access.
C. Data Bank Administration.
D. Database Administrator.
2020 By Eng. Joud Khattab
Question 47
■ E-R model uses which symbol to represent weak entity set :
A. Dotted rectangle
B. Diamond
C. Doubly outlined rectangle.
D. None of the above.
2020 By Eng. Joud Khattab
Question 47
■ E-R model uses which symbol to represent weak entity set :
A. Dotted rectangle
B. Diamond
C. Doubly outlined rectangle.
D. None of the above.
2020 By Eng. Joud Khattab
Question 48
■ The attributes made up of more than one single attributes are called :
A. Derived attribute
B. Composite attribute
C. Single value attribute
D. Multi value attribute
2020 By Eng. Joud Khattab
Question 48
■ The attributes made up of more than one single attributes are called :
A. Derived attribute
B. Composite attribute
C. Single value attribute
D. Multi value attribute
2020 By Eng. Joud Khattab
Question 49
■ What is the correct syntax of the declaration which defines the XML version?
A. <xml version="A.0" />
B. <?xml version="A.0"?>
C. <?xml version="A.0" />
D. None of the above
2020 By Eng. Joud Khattab
Question 49
■ What is the correct syntax of the declaration which defines the XML version?
A. <xml version="A.0" />
B. <?xml version="A.0"?>
C. <?xml version="A.0" />
D. None of the above
2020 By Eng. Joud Khattab
Question 50
■ Which of the following strings are a correct XML name?
A. xmlExtension
B. xslNewElement
C. XMLElement#123
D. All
2020 By Eng. Joud Khattab
Question 50
■ Which of the following strings are a correct XML name?
A. xmlExtension
B. xslNewElement
C. XMLElement#123
D. All
2020 By Eng. Joud Khattab
Question 51
■ Which clause from the following corresponds to the projection operation of the
relational algebra ?
A. From
B. Select
C. Where
D. Group by
2020 By Eng. Joud Khattab
Question 51
■ Which clause from the following corresponds to the projection operation of the
relational algebra ?
A. From
B. Select
C. Where
D. Group by
2020 By Eng. Joud Khattab
CONTACT INFO
2020 By Eng. Joud Khattab

Contenu connexe

Similaire à Database 2020

Informatica
InformaticaInformatica
Informaticamukharji
 
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem ChemAxon
 
Key Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to PostgresKey Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to PostgresEDB
 
Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2Eric Nelson
 
IT6701 Information Management - Unit I
IT6701 Information Management - Unit I  IT6701 Information Management - Unit I
IT6701 Information Management - Unit I pkaviya
 
Offline first: application data and synchronization
Offline first: application data and synchronizationOffline first: application data and synchronization
Offline first: application data and synchronizationEatDog
 
DataScience SG | Undergrad Series | 26th Sep 19
DataScience SG | Undergrad Series | 26th Sep 19DataScience SG | Undergrad Series | 26th Sep 19
DataScience SG | Undergrad Series | 26th Sep 19Yong Siang (Ivan) Tan
 
ISO 15926 Reference Data Engineering Methodology
ISO 15926 Reference Data Engineering MethodologyISO 15926 Reference Data Engineering Methodology
ISO 15926 Reference Data Engineering MethodologyAnatoly Levenchuk
 
10/ EnterpriseDB @ OPEN'16
10/ EnterpriseDB @ OPEN'16 10/ EnterpriseDB @ OPEN'16
10/ EnterpriseDB @ OPEN'16 Kangaroot
 
Review on Automation Tool for ERD Normalization
Review on Automation Tool for ERD NormalizationReview on Automation Tool for ERD Normalization
Review on Automation Tool for ERD NormalizationIRJET Journal
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework OverviewEric Nelson
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Dave Stokes
 
Best Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
Best Laid Plans: Saving Time, Money and Trouble with Optimal ForecastingBest Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
Best Laid Plans: Saving Time, Money and Trouble with Optimal ForecastingEric Kavanagh
 
Informatica Interview Questions & Answers
Informatica Interview Questions & AnswersInformatica Interview Questions & Answers
Informatica Interview Questions & AnswersZaranTech LLC
 

Similaire à Database 2020 (20)

Informatica
InformaticaInformatica
Informatica
 
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem
 
Key Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to PostgresKey Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to Postgres
 
Entity Framework v1 and v2
Entity Framework v1 and v2Entity Framework v1 and v2
Entity Framework v1 and v2
 
IT6701 Information Management - Unit I
IT6701 Information Management - Unit I  IT6701 Information Management - Unit I
IT6701 Information Management - Unit I
 
Offline first: application data and synchronization
Offline first: application data and synchronizationOffline first: application data and synchronization
Offline first: application data and synchronization
 
[iOS] Data Storage
[iOS] Data Storage[iOS] Data Storage
[iOS] Data Storage
 
B3 ps seco-intro
B3 ps seco-introB3 ps seco-intro
B3 ps seco-intro
 
DataScience SG | Undergrad Series | 26th Sep 19
DataScience SG | Undergrad Series | 26th Sep 19DataScience SG | Undergrad Series | 26th Sep 19
DataScience SG | Undergrad Series | 26th Sep 19
 
Thoughtful Software Design
Thoughtful Software DesignThoughtful Software Design
Thoughtful Software Design
 
ISO 15926 Reference Data Engineering Methodology
ISO 15926 Reference Data Engineering MethodologyISO 15926 Reference Data Engineering Methodology
ISO 15926 Reference Data Engineering Methodology
 
10/ EnterpriseDB @ OPEN'16
10/ EnterpriseDB @ OPEN'16 10/ EnterpriseDB @ OPEN'16
10/ EnterpriseDB @ OPEN'16
 
Review on Automation Tool for ERD Normalization
Review on Automation Tool for ERD NormalizationReview on Automation Tool for ERD Normalization
Review on Automation Tool for ERD Normalization
 
Entity Framework Overview
Entity Framework OverviewEntity Framework Overview
Entity Framework Overview
 
Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015Database Basics with PHP -- Connect JS Conference October 17th, 2015
Database Basics with PHP -- Connect JS Conference October 17th, 2015
 
Best Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
Best Laid Plans: Saving Time, Money and Trouble with Optimal ForecastingBest Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
Best Laid Plans: Saving Time, Money and Trouble with Optimal Forecasting
 
Informatica Interview Questions & Answers
Informatica Interview Questions & AnswersInformatica Interview Questions & Answers
Informatica Interview Questions & Answers
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Sq lite module4
Sq lite module4Sq lite module4
Sq lite module4
 
Ab initio training Ab-initio Architecture
Ab initio training Ab-initio ArchitectureAb initio training Ab-initio Architecture
Ab initio training Ab-initio Architecture
 

Plus de Joud Khattab

Customer Engagement Management
Customer Engagement ManagementCustomer Engagement Management
Customer Engagement ManagementJoud Khattab
 
Design thinking and Role Playing
Design thinking and Role PlayingDesign thinking and Role Playing
Design thinking and Role PlayingJoud Khattab
 
Algorithms and Data Structure 2020
Algorithms and Data Structure 2020Algorithms and Data Structure 2020
Algorithms and Data Structure 2020Joud Khattab
 
Artificial Intelligence 2020
Artificial Intelligence 2020Artificial Intelligence 2020
Artificial Intelligence 2020Joud Khattab
 
Automata and Compiler 2020
Automata and Compiler 2020Automata and Compiler 2020
Automata and Compiler 2020Joud Khattab
 
Software Engineering 2020
Software Engineering 2020Software Engineering 2020
Software Engineering 2020Joud Khattab
 
Software Engineering 2018
Software Engineering 2018Software Engineering 2018
Software Engineering 2018Joud Khattab
 
Automate and Compiler 2018
Automate and Compiler 2018Automate and Compiler 2018
Automate and Compiler 2018Joud Khattab
 
Artificial Intelligence 2018
Artificial Intelligence 2018Artificial Intelligence 2018
Artificial Intelligence 2018Joud Khattab
 
Algorithms and Data Structure 2018
Algorithms and Data Structure 2018Algorithms and Data Structure 2018
Algorithms and Data Structure 2018Joud Khattab
 
Geospatial Information Management
Geospatial Information ManagementGeospatial Information Management
Geospatial Information ManagementJoud Khattab
 
Big Data for Development
Big Data for DevelopmentBig Data for Development
Big Data for DevelopmentJoud Khattab
 
Personality Detection via MBTI Test
Personality Detection via MBTI TestPersonality Detection via MBTI Test
Personality Detection via MBTI TestJoud Khattab
 
Optimization Techniques
Optimization TechniquesOptimization Techniques
Optimization TechniquesJoud Khattab
 
Network Address Translation (NAT)
Network Address Translation (NAT)Network Address Translation (NAT)
Network Address Translation (NAT)Joud Khattab
 
From Image Processing To Computer Vision
From Image Processing To Computer VisionFrom Image Processing To Computer Vision
From Image Processing To Computer VisionJoud Khattab
 

Plus de Joud Khattab (20)

Customer Engagement Management
Customer Engagement ManagementCustomer Engagement Management
Customer Engagement Management
 
Design thinking and Role Playing
Design thinking and Role PlayingDesign thinking and Role Playing
Design thinking and Role Playing
 
Algorithms and Data Structure 2020
Algorithms and Data Structure 2020Algorithms and Data Structure 2020
Algorithms and Data Structure 2020
 
Artificial Intelligence 2020
Artificial Intelligence 2020Artificial Intelligence 2020
Artificial Intelligence 2020
 
Automata and Compiler 2020
Automata and Compiler 2020Automata and Compiler 2020
Automata and Compiler 2020
 
Software Engineering 2020
Software Engineering 2020Software Engineering 2020
Software Engineering 2020
 
Software Engineering 2018
Software Engineering 2018Software Engineering 2018
Software Engineering 2018
 
Automate and Compiler 2018
Automate and Compiler 2018Automate and Compiler 2018
Automate and Compiler 2018
 
Artificial Intelligence 2018
Artificial Intelligence 2018Artificial Intelligence 2018
Artificial Intelligence 2018
 
Algorithms and Data Structure 2018
Algorithms and Data Structure 2018Algorithms and Data Structure 2018
Algorithms and Data Structure 2018
 
Data Storytelling
Data StorytellingData Storytelling
Data Storytelling
 
Geospatial Information Management
Geospatial Information ManagementGeospatial Information Management
Geospatial Information Management
 
Big Data for Development
Big Data for DevelopmentBig Data for Development
Big Data for Development
 
Personality Detection via MBTI Test
Personality Detection via MBTI TestPersonality Detection via MBTI Test
Personality Detection via MBTI Test
 
Fog Computing
Fog ComputingFog Computing
Fog Computing
 
Seasonal ARIMA
Seasonal ARIMASeasonal ARIMA
Seasonal ARIMA
 
Optimization Techniques
Optimization TechniquesOptimization Techniques
Optimization Techniques
 
Network Address Translation (NAT)
Network Address Translation (NAT)Network Address Translation (NAT)
Network Address Translation (NAT)
 
From Image Processing To Computer Vision
From Image Processing To Computer VisionFrom Image Processing To Computer Vision
From Image Processing To Computer Vision
 
Spark SQL
Spark SQLSpark SQL
Spark SQL
 

Dernier

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Dernier (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Database 2020

  • 2. Content ■ Overview. ■ Entity Relational Model. ■ Relational Model. ■ SQL. ■ XML. ■ Normalization. ■ Rational Algebra. ■ MCQ. 2020 By Eng. Joud Khattab
  • 3. OVERVIEW 2020 By Eng. Joud Khattab
  • 4. Definitions (‫)تعاريف‬ ■‫المعطيات‬ ‫قاعدة‬( :Database) –،‫المتكررة‬ ‫غير‬ ‫المهيكلة‬ ‫المعطيات‬ ‫من‬ ‫مجموعة‬ –‫تطبيقي‬ ‫برامج‬ ‫عدة‬ ‫قبل‬ ‫من‬ ‫إليها‬ ‫بالوصول‬ ‫يسمح‬ ‫تخزين‬ ‫وسط‬ ‫على‬ ‫المسجلة‬‫ة‬. ■‫المعطيات‬ ‫قواعد‬ ‫إدارة‬ ‫نظام‬( :DBMS: Data Base Management Systems) –،‫بينها‬ ‫فيما‬ ‫المرتبطة‬ ‫المعطيات‬ ‫من‬ ‫تجمع‬ –‫المعطيات‬ ‫هذه‬ ‫إلى‬ ‫الوصول‬ ‫توفر‬ ‫التي‬ ‫البرامج‬ ‫من‬ ‫ومجموعة‬. ■‫المعطيات‬ ‫قواعد‬ ‫إدارة‬ ‫نظم‬ ‫أهداف‬: –‫المعطيات‬ ‫واسترجاع‬ ‫تخزين‬ ‫من‬ ‫يمكن‬ ‫وفعال‬ ‫مالئم‬ ‫عمل‬ ‫محيط‬ ‫توفير‬. –‫التقليدية‬ ‫المعطيات‬ ‫وإدارة‬ ‫تخزين‬ ‫نظم‬ ‫مساوئ‬ ‫على‬ ‫التغلب‬(‫الملفات‬ ‫نظام‬.) 2020 By Eng. Joud Khattab
  • 5. Database Applications (‫المعطيات‬ ‫قواعد‬ ‫)تطبيقات‬ ■‫الطالب‬ ‫شؤون‬(Universities:)‫العالمات‬ ،‫المواد‬ ،‫التسجيل‬. ■‫البشرية‬ ‫الموارد‬(Human resources:)‫الضرائب‬ ،‫الرواتب‬ ،‫الموظفين‬ ‫سجالت‬. ■‫المبيعات‬(Sales:)‫والمشتريات‬ ‫والمنتجات‬ ‫الزبائن‬ ■‫التصنيع‬(Manufacturing:)‫التوريد‬ ،‫الطلبات‬ ،‫التخزين‬ ،‫اإلنتاج‬. ■‫الجوية‬ ‫الخطوط‬(Airlines:)‫الرحالت‬ ‫وتنظيم‬ ‫الحجز‬. ■‫المصارف‬(Banking:)‫المصرفية‬ ‫المعامالت‬. 2020 By Eng. Joud Khattab
  • 6. Database Problems (‫المعطيات‬ ‫قواعد‬ ‫)مشاكل‬ ■‫المعطيات‬ ‫وتضارب‬ ‫تكرار‬: –‫ملف‬ ‫من‬ ‫أكثر‬ ‫في‬ ‫المعلومات‬ ‫لنفس‬ ‫تكرار‬ ،‫للملفات‬ ‫مختلفة‬ ‫وأشكال‬ ‫بنى‬. ■‫المعطيات‬ ‫إلى‬ ‫الوصول‬ ‫صعوبة‬: –‫المختلفة‬ ‫االستفسارات‬ ‫لمعالجة‬ ‫جديدة‬ ‫برامج‬ ‫لكتابة‬ ‫الحاجة‬. ■‫المعطيات‬ ‫تكامل‬ ‫عدم‬: –‫الموجو‬ ‫الشروط‬ ‫في‬ ‫التغيير‬ ‫أو‬ ‫جديدة‬ ‫شروط‬ ‫إضافة‬ ‫الصعب‬ ‫ومن‬ ‫البرامج‬ ‫ضمن‬ ‫مكتوبة‬ ‫تكون‬ ‫المعطيات‬ ‫على‬ ‫الشروط‬‫دة‬. –‫مختلفة‬ ‫ملفات‬ ‫في‬ ‫موجودة‬ ‫معطيات‬ ‫بعناصر‬ ‫الشرط‬ ‫يتعلق‬ ‫عندما‬ ‫الصعوبة‬ ‫تزداد‬. ■‫التعديالت‬ ‫تجزئة‬: –‫جزئية‬ ‫تعديالت‬ ‫لتنفيذ‬ ‫نتيجة‬ ‫صحيحة‬ ‫وغير‬ ‫مستقرة‬ ‫غير‬ ‫بحالة‬ ‫القاعدة‬ ‫تترك‬ ‫أن‬ ‫لألعطال‬ ‫يمكن‬. ■‫المتزامن‬ ‫بالوصول‬ ‫التحكم‬ ‫صعوبة‬: –‫أخطاء‬ ‫إلى‬ ‫يؤدي‬ ‫أن‬ ‫به‬ ‫المتحكم‬ ‫غير‬ ‫المتزامن‬ ‫للوصول‬ ‫يمكن‬. –‫مثال‬:‫الوقت‬ ‫نفس‬ ‫في‬ ‫مستخدمين‬ ‫قبل‬ ‫من‬ ‫رصيد‬ ‫وتعديل‬ ‫قراءة‬. ■‫المعلومات‬ ‫أمن‬ ‫تطبيق‬ ‫صعوبة‬. 2020 By Eng. Joud Khattab
  • 7. DBMS Functions (‫المعطيات‬ ‫قواعد‬ ‫إدارة‬ ‫أنظمة‬ ‫)وظائف‬ ■‫المعلومات‬ ‫مركزية‬. ■‫المعطيات‬ ‫استقالل‬. ■‫إجرائية‬ ‫غير‬ ‫لغات‬ ‫بواسطة‬ ‫المعطيات‬ ‫معالجة‬. ■‫المعطيات‬ ‫بإدارة‬ ‫الخاصة‬ ‫التسهيالت‬. ■‫بفعالية‬ ‫المعطيات‬ ‫إلى‬ ‫الوصول‬. ■‫المعطيات‬ ‫تكرار‬ ‫في‬ ‫التحكم‬. ■‫المعطيات‬ ‫تكامل‬. ■‫المعطيات‬ ‫تقسيم‬. ■‫المعطيات‬ ‫أمن‬ ‫توفير‬. 2020 By Eng. Joud Khattab
  • 8. Database Structure (‫المعطيات‬ ‫قواعد‬ ‫)بنية‬ ■‫مركزية‬(Centralized) ■‫مخدم‬ ‫زبون‬(Client Server) ■‫تفرعيه‬(Parallel) ■‫موزعة‬(Distributed Database) 2020 By Eng. Joud Khattab
  • 9. Applications Architecture (‫التطبيقات‬ ‫)بنية‬ ■‫طريق‬ ‫عن‬ ‫المعطيات‬ ‫قاعدة‬ ‫مع‬ ‫التطبيقية‬ ‫البرامج‬ ‫تتصل‬: –‫تعليمات‬ ‫وجود‬ ‫تقبل‬ ‫البرمجة‬ ‫للغة‬ ‫توسيعات‬(SQL) –‫برمجية‬ ‫تخاطب‬ ‫واجهة‬(API.) 2020 By Eng. Joud Khattab
  • 10. Database Levels (‫التجريد‬ ‫)مستويات‬ ■‫المفاهيمي‬ ‫المستوى‬:‫واالرتباطات‬ ‫الكيانات‬ ‫مخططات‬ ‫مثل‬(ERD) ■‫المنطقي‬ ‫المستوى‬:‫النموذج‬ ‫مثل‬‫العالقاتي‬ ■‫الفيزيائي‬ ‫المستوى‬. 2020 By Eng. Joud Khattab
  • 11. ENTITY RELATIONSHIP MODEL ‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫نموذج‬ 2020 By Eng. Joud Khattab
  • 12. Entity Relationship Model (‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬ ■‫الكيانات‬ ‫هذه‬ ‫بين‬ ‫فيما‬ ‫واالرتباطات‬ ‫الكيانات‬ ‫من‬ ‫مجموعة‬ ‫هي‬ ‫المعطيات‬ ‫قاعدة‬ ■‫الكيان‬( :entity) –‫قاعدة‬ ‫في‬ ‫تخزينها‬ ‫سيجري‬ ‫التي‬ ‫األغراض‬ ‫من‬ ‫غيره‬ ‫عن‬ ‫ومميز‬ ‫موجود‬ ‫غرض‬ ‫المعطيات‬:‫المدرس‬ ‫وكيان‬ ‫الطالب‬ ‫كيان‬ ‫مثل‬ –‫واصفات‬ ‫له‬ ‫الكيان‬(attributes:)‫وعنوان‬ ‫اسم‬ ‫شخص‬ ‫لكل‬ ‫مثال‬ –‫رئيسي‬ ‫مفتاح‬ ‫له‬ ‫الكيان‬(primary key) ■‫االرتباط‬( :relationship) –‫أكثر‬ ‫أو‬ ‫كيانين‬ ‫بين‬ ‫اقتران‬ ‫هو‬. –‫المدرس‬ ‫مع‬ ‫الطالب‬ ‫ارتباط‬ ‫مثل‬. –‫واصفات‬ ‫له‬ ‫تكون‬ ‫أن‬ ‫يمكن‬ ً‫أيضا‬ ‫االرتباط‬. 2020 By Eng. Joud Khattab
  • 13. Entity Relationship Model (‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬ 2020 By Eng. Joud Khattab
  • 14. Entity Relationship Model (‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬ ■‫الواصفات‬ ‫أنواع‬: –‫البسيطة‬ ‫الوصفات‬(simple:)‫الراتب‬ ،‫الكنية‬ ،‫االسم‬ ‫مثل‬. –‫المركبة‬ ‫الواصفات‬(composite:)‫العنوان‬ ،‫الثالثي‬ ‫االسم‬ ‫مثل‬. –‫القيم‬ ‫المتعددة‬ ‫الواصفات‬(multivalued:)‫الهاتف‬ ‫أرقام‬ ‫مثل‬. –‫المشتقة‬ ‫الواصفات‬(derived:)‫الراتب‬ ،‫العمر‬ ‫مثل‬ ‫أخرى‬ ‫واصفات‬ ‫من‬ ‫حسابها‬ ‫يتم‬ ‫السنوي‬. 2020 By Eng. Joud Khattab
  • 15. Entity Relationship Model (‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬ ■‫االرتباطات‬ ‫أنواع‬: –‫االرتباط‬ ‫درجة‬:‫المرتبطة‬ ‫الكيانات‬ ‫عدد‬ ■‫رباعية‬ ،‫ثالثية‬ ‫تكون‬ ‫أن‬ ‫يمكن‬ ‫لكن‬ ‫ثنائية‬ ‫االرتباطات‬ ‫معظم‬. ■‫ثالثية‬ ‫عالقة‬ ‫عن‬ ‫مثال‬:‫مشرف‬ ‫مدرس‬ ‫مع‬ ‫مشروع‬ ‫مع‬ ‫طالب‬ ‫عالقة‬. –‫لالرتباط‬ ‫العددية‬ ‫القيود‬: ■‫لواحد‬ ‫واحد‬(One to one) ■‫لعدة‬ ‫واحد‬(One to many) ■‫لواحد‬ ‫عدة‬(Many to one) ■‫لعدة‬ ‫عدة‬(Many to many) –‫المشاركة‬ ‫قيود‬: ■‫كاملة‬ ‫مشاركة‬(‫إجبارية‬ ‫عالقة‬) ■‫جزئية‬ ‫مشاركة‬(‫اختيارية‬ ‫عالقة‬) 2020 By Eng. Joud Khattab
  • 16. Entity Relationship Model (‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬ ■‫المفاتيح‬: –‫الرئيسي‬ ‫المفتاح‬ ‫أو‬ ‫األعلى‬ ‫المفتاح‬(super key) ■‫الكيانات‬ ‫مجموعة‬ ‫من‬ ‫واحد‬ ‫كيان‬ ‫بتمييز‬ ‫متجمعة‬ ‫تسمح‬ ‫اكثر‬ ‫او‬ ‫واصفا‬ ‫تضم‬ ‫مجموعة‬ ‫واحد‬ ‫صف‬ ‫الى‬ ‫المنتمية‬. –‫المرشح‬ ‫المفتاح‬(candidate key) ■‫هذه‬ ‫من‬ ‫جزئية‬ ‫مجموعة‬ ‫توجد‬ ‫وال‬ ‫الواصفات‬ ‫من‬ ‫مجموعة‬ ‫من‬ ‫مؤلف‬ ‫رئيسي‬ ‫مفتاح‬ ‫رئيسيا‬ ‫مفتاحا‬ ‫تكون‬ ‫المجموعة‬. –‫األولي‬ ‫المفتاح‬(primary key) ■‫البعض‬ ‫بعضها‬ ‫عن‬ ‫الكيانات‬ ‫لتمييز‬ ‫أساسية‬ ‫كطريقة‬ ‫المصمم‬ ‫اختاره‬ ‫مرشح‬ ‫مفتاح‬ ‫واحد‬ ‫كيانات‬ ‫صف‬ ‫الى‬ ‫والمنتمية‬. 2020 By Eng. Joud Khattab
  • 17. Entity Relationship Model (‫االرتباطات‬ ‫و‬ ‫الكيانات‬ ‫)نموذج‬ ■ A software release can be identified either by: – major/minor version or by the date. ■ (year, major, minor) or (year, month, date, major) – are super keys (since they are unique) – but not candidate keys, (since you can remove year or major and the remaining set will still be a super key) ■ (year, month, date) and (major, minor) – are candidate keys, since you cannot remove any of the fields from them without breaking uniqueness. Year Month Date Major Minor 2008 01 13 0 1 2008 04 23 0 2 2009 11 05 1 0 2010 04 05 1 1 2020 By Eng. Joud Khattab
  • 18. Entity Relationship Diagram (ERD) ( ‫كيان‬ ‫مخطط‬-‫ارتباط‬ ) One to One One to Many Many to Many 2020 By Eng. Joud Khattab
  • 19. Entity Relationship Diagram (ERD) ( ‫كيان‬ ‫مخطط‬-‫ارتباط‬ ) ■‫الواصفات‬ ‫من‬ ‫المختلفة‬ ‫األنواع‬ ‫تمثيل‬: 2020 By Eng. Joud Khattab
  • 20. Entity Relationship Diagram (ERD) ( ‫كيان‬ ‫مخطط‬-‫ارتباط‬ ) ■‫الضعيف‬ ‫الكيان‬(weak entity) –‫اولي‬ ‫مفتاح‬ ‫له‬ ‫ليس‬(primary key)‫عناصره‬ ‫بين‬ ‫يميز‬. –‫المحدد‬ ‫الكيان‬ ‫أو‬ ‫القوي‬ ‫الكيان‬ ‫يسمى‬ ‫آخر‬ ‫كيان‬ ‫بوجود‬ ‫مرهون‬ ‫وجوده‬. –‫التحديد‬ ‫عالقة‬ ‫تسمى‬ ‫إجبارية‬ ‫لواحد‬ ‫عدة‬ ‫بعالقة‬ ‫القوي‬ ‫الكيان‬ ‫مع‬ ‫يرتبط‬. –‫الواحد‬ ‫القوي‬ ‫الكيان‬ ‫ضمن‬ ‫عناصره‬ ‫بين‬ ‫يميز‬ ‫مميز‬ ‫له‬. –‫القو‬ ‫للكيان‬ ‫الرئيسي‬ ‫والمفتاح‬ ‫المميز‬ ‫من‬ ً‫مؤلفا‬ ‫الرئيسي‬ ‫مفتاحه‬ ‫يصبح‬‫المرتبط‬ ‫ي‬ ‫به‬. 2020 By Eng. Joud Khattab
  • 22. FROM ERD TO RELATIONAL MODEL ‫النموذج‬ ‫إلى‬ ‫واالرتباطات‬ ‫الكيانات‬ ‫نموذج‬ ‫من‬ ‫التحويل‬‫العالقاتي‬ 2020 By Eng. Joud Khattab
  • 23. From ERD to Relational model ■‫البسيطة‬ ‫الواصفات‬ ‫ذات‬ ‫القوية‬ ‫الكيانات‬ ‫تحويل‬: –‫نفسه‬ ‫الرئيسي‬ ‫والمفتاح‬ ‫نفسها‬ ‫الواصفات‬ ‫لها‬ ‫عالقة‬ ‫إلى‬ ‫الكيان‬ ‫يتحول‬. ■‫الضعيفة‬ ‫الكيانات‬ ‫تحويل‬: –،‫نفسها‬ ‫الواصفات‬ ‫لها‬ ‫عالقة‬ ‫إلى‬ ‫الضعيف‬ ‫الكيان‬ ‫يتحول‬ –،‫له‬ ‫المحدد‬ ‫القوي‬ ‫للكيان‬ ‫الرئيسي‬ ‫المفتاح‬ ‫واصفات‬ ‫إلى‬ ً‫ة‬‫إضاف‬ –،‫للعالقة‬ ً‫رئيسيا‬ ً‫مفتاحا‬ ‫المميزة‬ ‫الواصفات‬ ‫مع‬ ‫تصبح‬ ‫التي‬ –‫الكيانين‬ ‫بين‬ ‫االرتباط‬ ‫يمثل‬ ً‫خارجيا‬ ً‫مفتاحا‬ ‫وتكون‬. 2020 By Eng. Joud Khattab
  • 24. From ERD to Relational model ■‫لواحد‬ ‫واحد‬ ‫الروابط‬( :one-to-one) –‫ال‬ ‫أحد‬ ‫في‬ ‫الموجود‬ ‫الكيان‬ ‫عن‬ ‫الناتجة‬ ‫للعالقة‬ ‫الرئيسي‬ ‫المفتاح‬ ‫إضافة‬ ‫يمكن‬‫طرفين‬ ً‫خارجيا‬ ً‫مفتاحا‬ ‫ليصبح‬ ‫اآلخر‬ ‫الطرف‬ ‫في‬ ‫الموجود‬ ‫الكيان‬ ‫عن‬ ‫الناتجة‬ ‫العالقة‬ ‫إلى‬‫فيها‬. ■‫لعدة‬ ‫واحد‬ ‫الروابط‬( :one-to-many) –‫الطر‬ ‫في‬ ‫الموجود‬ ‫الكيان‬ ‫عن‬ ‫الناتجة‬ ‫للعالقة‬ ‫الرئيسي‬ ‫المفتاح‬ ‫بإضافة‬ ‫يمكن‬‫ف‬(one) ‫الطرف‬ ‫في‬ ‫الموجود‬ ‫الكيان‬ ‫عن‬ ‫الناتجة‬ ‫العالقة‬ ‫إلى‬(many)ً‫خارجيا‬ ً‫مفتاحا‬ ‫ليصبح‬ ‫فيها‬. ■‫لعدة‬ ‫عدة‬ ‫االرتباطات‬( :many-to-many) –‫الك‬ ‫عن‬ ‫الناتجة‬ ‫للعالقات‬ ‫الرئيسية‬ ‫المفاتيح‬ ‫تتضمن‬ ‫عالقات‬ ‫بإضافة‬ ‫يمكن‬‫يانات‬ ‫وي‬ ‫الجديدة‬ ‫للعالقة‬ ‫الرئيسي‬ ‫المفتاح‬ ‫مجتمعة‬ ‫تشكل‬ ‫والتي‬ ‫فيها‬ ‫المشاركة‬‫كل‬ ‫صبح‬ ‫منه‬ ‫أتى‬ ‫الذي‬ ‫الكيان‬ ‫وعالقة‬ ‫الجديدة‬ ‫العالقة‬ ‫بين‬ ‫خارجي‬ ‫مفتاح‬ ‫منها‬.‫تضاف‬ ‫ثم‬ ‫وجدت‬ ‫إن‬ ‫االرتباط‬ ‫واصفات‬. 2020 By Eng. Joud Khattab
  • 25. Relational Model ( ‫النموذج‬‫العالقاتي‬ ) ■‫عالقة‬/‫المدرس‬ ‫جدول‬ Attributes ‫واصفات‬ (or columns ‫)أعمدة‬ Tuples ‫صفوف‬ (or rows ‫)أسطر‬ 2020 By Eng. Joud Khattab
  • 26. Relational Model ( ‫النموذج‬‫العالقاتي‬ ) ■‫المفاتيح‬: –‫الرئيسي‬ ‫المفتاح‬(primary key) ■‫واصفات‬ ‫مجموعة‬ ‫أو‬ ‫واصفة‬ ‫هو‬‫أصغرية‬‫وحيد‬ ‫بشكل‬ ‫صف‬ ‫تحدد‬. ■‫مثل‬:ID‫للعالقة‬ ‫رئيسي‬ ‫مفتاح‬ ‫هو‬Instructor –‫الخارجي‬ ‫المفتاح‬(Foreign key) ■‫الع‬ ‫في‬ ‫الواصفات‬ ‫إحدى‬ ‫لقيمة‬ ‫مقابلة‬ ‫قيمة‬ ‫وجود‬ ‫تضمن‬ ‫عالقتين‬ ‫لربط‬ ‫وسيلة‬ ‫هو‬‫القة‬ ‫األولى‬(Referencing relation)‫الثانية‬ ‫العالقة‬ ‫ضمن‬(Referenced relation) ■‫مثل‬:dept_name‫العالقة‬ ‫في‬ ‫خارجي‬ ‫مفتاح‬ ‫هو‬Instructor‫في‬ ‫رئيسي‬ ‫مفتاح‬ ‫يقابله‬ ‫العالقة‬department 2020 By Eng. Joud Khattab
  • 27. STRUCTURED QUERY LANGUAGE (SQL) ‫االستعالم‬ ‫لغة‬ 2020 By Eng. Joud Khattab
  • 28. Overview ■‫المعطيات‬ ‫قواعد‬ ‫لغات‬: –‫المعطيات‬ ‫تعريف‬ ‫لغة‬( :DDL Data Definition Language) –‫المعطيات‬ ‫مع‬ ‫التعامل‬ ‫لغة‬( :DML Data Manipulation Language) ■‫إجرائية‬ ‫لغات‬:‫إليها‬ ‫يحتاج‬ ‫التي‬ ‫المعطيات‬ ‫تحديد‬ ‫المستثمر‬ ‫من‬ ‫تتطلب‬‫ال‬ ‫وطريقة‬‫حصول‬ ‫عليها‬. ■‫إجرائية‬ ‫غير‬ ‫لغات‬:‫إليها‬ ‫يحتاج‬ ‫التي‬ ‫المعطيات‬ ‫تحديد‬ ‫المستثمر‬ ‫من‬ ‫تتطلب‬‫ت‬ ‫دون‬‫حديد‬ ‫عليها‬ ‫الحصول‬ ‫كيفية‬. 2020 By Eng. Joud Khattab
  • 29. Overview 2020 By Eng. Joud Khattab
  • 30. Data Definition Language (DDL) (‫المعطيات‬ ‫تعريف‬ ‫)لغة‬ ■ Create a Table (‫جدول‬ ‫)بناء‬ ■ Examples: – create table instructor ( ID char(5), name varchar(20) not null, dept_name varchar(20), salary numeric(8,2), primary key (ID), foreign key (dept_name) references department) 2020 By Eng. Joud Khattab
  • 31. Data Definition Language (DDL) (‫المعطيات‬ ‫تعريف‬ ‫)لغة‬ ■ Alter & Drop Tables: (‫وحذفها‬ ‫الجداول‬ ‫)تعديل‬ ■ Examples: – alter table r add A D – alter table r drop A – drop table r 2020 By Eng. Joud Khattab
  • 32. Data Manipulation Language (DML) (‫المعطيات‬ ‫مع‬ ‫التعامل‬ ‫)لغة‬ ■ Insert (‫)اإلدخال‬ ■ Examples: – insert into course values (’CS-437’, ’Database Systems’, ’Comp. Sci.’, 4); – insert into course (course_id, title, credits, dept_name) values (’CS-437’, ’Database Systems’, 4, ’Comp. Sci.’); – insert into student values (’3003’, ’Green’, ’Finance’, null); – insert into student select ID, name, dept_name, 0 from instructor; – insert into table1 select * from table1; 2020 By Eng. Joud Khattab
  • 33. Data Manipulation Language (DML) (‫المعطيات‬ ‫مع‬ ‫التعامل‬ ‫)لغة‬ ■ Update (‫)التعديل‬ ■ Examples: – update instructor set salary = salary * 1.03 where salary > 100000; 2020 By Eng. Joud Khattab
  • 34. Data Manipulation Language (DML) (‫المعطيات‬ ‫مع‬ ‫التعامل‬ ‫)لغة‬ ■ Delete (‫)الحذف‬ – delete from instructor – delete from instructor where dept name in (select dept name from department where building = ’Watson’); – delete from instructor where salary < (select avg (salary) from instructor); 2020 By Eng. Joud Khattab
  • 35. Select Clause Rule ■ Rule: select A1, A2, ..., An from r1, r2, ..., rm where P ■ Examples: – select * from instructor – select ID, name, salary/12 from instructor – select distinct dept_name from instructor 2020 By Eng. Joud Khattab
  • 36. Select Clause Conditions ■ select name from instructor where dept_name = ‘Comp. Sci.' and salary > 80000 ■ select name, course_id from instructor, teaches where (instructor.ID, dept_name) = (teaches.ID, ’Biology’); 2020 By Eng. Joud Khattab
  • 37. Select Clause Join (‫)الضم‬ ■ select * from instructor, teaches ■‫ديكارتي‬ ‫جداء‬ ‫يعني‬ ‫شروط‬ ‫بدون‬ ‫جدول‬ ‫من‬ ‫أكثر‬ ‫وجود‬. ■‫أخرى‬ ‫شروط‬ ‫بدون‬ ‫مفيد‬ ‫غير‬ ‫الديكارتي‬ ‫الجداء‬. 2020 By Eng. Joud Khattab
  • 38. Select Clause Join (‫)الضم‬ ■‫شروط‬ ‫مع‬ ‫لكن‬ ‫ديكارتي‬ ‫جداء‬. ■‫مثال‬: –‫أعطوها‬ ‫التي‬ ‫المواد‬ ‫أرقام‬ ‫مع‬ ً‫دروسا‬ ‫أعطوا‬ ‫الذين‬ ‫المدرسين‬ ‫أسماء‬ ‫أوجد‬ – select name, course_id from instructor, teaches where instructor.ID = teaches.ID –‫النظم‬ ‫قسم‬ ‫يعطيها‬ ‫التي‬ ‫للمواد‬ ‫والسنة‬ ‫والفصل‬ ‫وعنوانها‬ ‫المادة‬ ‫رقم‬ ‫أوجد‬ ‫المعلوماتية‬ – select section.course_id, title, semester, year from section, course where section.course_id = course.course_id and dept_name = ‘Comp. Sci.' 2020 By Eng. Joud Khattab
  • 39. Select Clause Natural Join (‫الطبيعي‬ ‫)الضم‬ ■ course natural join prereq 2020 By Eng. Joud Khattab
  • 40. Select Clause Outer Join (‫الخارجي‬ ‫)الضم‬ course natural left outer join prereq course natural right outer join prereq course natural full outer join prereq 2020 By Eng. Joud Khattab
  • 41. Select Clause Renaming (‫التسمية‬ ‫)إعادة‬ ■‫كلمة‬ ‫باستخدام‬ ‫والواصفات‬ ‫العالقات‬ ‫تسمية‬ ‫إعادة‬ ‫يمكن‬as ■ select ID, name, salary/12 as monthly_salary from instructor ■‫النظم‬ ‫قسم‬ ‫مدرسي‬ ‫أحد‬ ‫من‬ ‫أعلى‬ ً‫راتبا‬ ‫يقبضون‬ ‫الذين‬ ‫المدرسين‬ ‫أسماء‬ ‫أوجد‬ ‫المعلوماتية‬ ■ select distinct T.name from instructor as T, instructor as S where T.salary > S.salary and S.dept_name = ‘Comp. Sci.’ 2020 By Eng. Joud Khattab
  • 42. Select Clause Order (‫النتائج‬ ‫)ترتيب‬ ■‫واصفات‬ ‫عدة‬ ‫أو‬ ‫واصفة‬ ‫قيم‬ ‫بحسب‬ ‫ترتيب‬. ■‫الواصفة‬ ‫بحسب‬ ‫أبجدي‬ ‫أو‬ ‫رقمي‬ ‫ترتيب‬. ■‫تصاعدي‬ ‫ترتيب‬asc‫تنازلي‬ ‫أو‬desc ■ select distinct name from instructor order by name 2020 By Eng. Joud Khattab
  • 43. Select Clause (‫المحارف‬ ‫سالسل‬ ‫على‬ ‫)العمليات‬ ■‫العملية‬ ‫باستخدام‬ ‫تقريبية‬ ‫مطابقة‬like –‫معدومة‬ ‫تكون‬ ‫قد‬ ‫محارف‬ ‫مجموعة‬ ‫أو‬ ‫محرف‬ ‫لمطابقة‬ ‫خاص‬ ‫محرف‬% –‫واحد‬ ‫محرف‬ ‫لمطابقة‬ ‫خاص‬ ‫محرف‬_ ■ select name from instructor where name like '%dar%' ■‫المحرفين‬ ‫هذين‬ ‫أحد‬ ‫يتضمن‬ ‫عنه‬ ‫نبحث‬ ‫ما‬ ‫كان‬ ‫لو‬ ‫ماذا‬ –‫عن‬ ‫نبحث‬ ً‫مثال‬ ‫كنا‬ ‫إذا‬“100%” –‫المحرف‬ ‫عمل‬ ‫نلغي‬%‫إلغاء‬ ‫محرف‬ ‫باستخدام‬like ‘100 %' escape '' ■‫المحارف‬ ‫سالسل‬ ‫على‬ ‫أخرى‬ ‫عمليات‬ –‫الدمج‬concatenation ( “||”) –‫والكبيرة‬ ‫الصغيرة‬ ‫األحرف‬ ‫بين‬ ‫التحويل‬upper, lower –‫محارف‬ ‫سلسلة‬ ‫طول‬length –‫السلسلة‬ ‫من‬ ‫معين‬ ‫مكان‬ ‫من‬ ً‫بدءا‬ ‫معين‬ ‫بطول‬ ‫جزء‬ ‫استخراج‬substring 2020 By Eng. Joud Khattab
  • 44. Select Clause Set Operations (‫المجموعات‬ ‫على‬ ‫)العمليات‬ ■ (select course_id from section where sem = ‘Fall’ and year = 2009) union (select course_id from section where sem = ‘Spring’ and year = 2010) ■ (select course_id from section where sem = ‘Fall’ and year = 2009) intersect (select course_id from section where sem = ‘Spring’ and year = 2010) ■ (select course_id from section where sem = ‘Fall’ and year = 2009) except (select course_id from section where sem = ‘Spring’ and year = 2010) ■‫مالحظة‬: –‫آلي‬ ‫حذف‬‫للتكرارس‬ –‫العمليات‬ ‫تستخدم‬ ‫التكرار‬ ‫إلبقاء‬union all, intersect all, except all 2020 By Eng. Joud Khattab
  • 45. Select Clause Null Values (‫المعدومة‬ ‫)القيم‬ ■‫واردة‬ ‫غير‬ ‫أو‬ ‫معروفة‬ ‫غير‬ ‫أو‬ ‫موجودة‬ ‫غير‬ ‫قيمة‬ ■‫القيمة‬ ‫كانت‬ ‫إذا‬ ‫نختبر‬ ‫أن‬ ‫يمكن‬null‫الشرط‬ ‫باستخدام‬is null ■ select name from instructor where salary is null; ■‫القيمة‬ ‫تتضمن‬ ‫رياضية‬ ‫عملية‬ ‫نتيجة‬null‫هي‬null(5 + null = null) ■ OR: (unknown or true) = true (unknown or false) = unknown (unknown or unknown) = unknown ■ AND: (true and unknown) = unknown (false and unknown) = false, (unknown and unknown) = unknown ■ NOT: (not unknown) = unknown ■‫الطرفين‬ ‫أحد‬ ‫كان‬ ‫إذا‬ ‫المقارنة‬ ‫عمليات‬ ‫في‬null‫النتيجة‬ ‫تكون‬unknown ■‫التركيب‬ ‫نتيجة‬where‫أنها‬ ‫على‬ ‫معها‬ ‫التعامل‬ ‫يجري‬false‫تساوي‬ ‫كانت‬ ‫إذا‬unknown 2020 By Eng. Joud Khattab
  • 46. Select Clause Aggregate Functions (‫التجميع‬ ‫)توابع‬ ■‫واحدة‬ ‫قيمة‬ ‫وتعيد‬ ‫قيم‬ ‫مجموعة‬ ‫دخلها‬ ‫في‬ ‫تأخذ‬ ‫توابع‬ ■ select avg (salary) from instructor where dept_name= ’Comp. Sci.’; ■ select count (*) from course; ■ select count (distinct ID) from teaches where semester = ’Spring’ and year = 2010; ■‫القيمة‬ ‫التجميع‬ ‫توابع‬ ‫تجاهل‬null avg: average value min: minimum value max: maximum value sum: sum of values count: number of values 2020 By Eng. Joud Khattab
  • 47. Select Clause Group By (‫واصفة‬ ‫بحسب‬ ‫)التجميع‬ ■‫مالحظات‬: –‫واصفة‬ ‫من‬ ‫أكثر‬ ‫على‬ ‫التجميع‬ ‫يمكن‬ –‫قائمة‬ ‫في‬ ‫التجميعي‬ ‫التابع‬ ‫خارج‬ ‫الموجودة‬ ‫الواصفات‬ ‫جميع‬ ‫تظهر‬ ‫أن‬ ‫يجب‬group by select dept_name, avg (salary) from instructor group by dept_name; 2020 By Eng. Joud Khattab
  • 48. Select Clause Having ‫التجميع‬ ‫على‬ ‫الشروط‬ ■‫مالحظة‬: –‫في‬ ‫الموجود‬ ‫الشرط‬ ‫يطبق‬having‫شرط‬ ‫يطبق‬ ‫بينما‬ ‫المجموعات‬ ‫تشكيل‬ ‫بعد‬where‫تشكيلها‬ ‫قبل‬ select dept_name, avg (salary) from instructor group by dept_name having avg (salary) > 42000; 2020 By Eng. Joud Khattab
  • 49. Views (‫)الرؤى‬ ■‫الجداول‬ ‫على‬ ‫المعقدة‬ ‫االستعالمات‬ ‫لتسهيل‬ ‫وسيلة‬. ■ً‫فعليا‬ ‫مخزنة‬ ‫غير‬ ‫افتراضية‬ ‫جداول‬. ■‫بلغة‬ ‫مكتوبة‬ ‫اسم‬ ‫ولها‬ ‫مخزنة‬ ‫استعالمات‬SQL ■‫آخر‬ ‫جدول‬ ‫كأي‬ ‫استخدامها‬ ‫يمكن‬ ‫إنشائها‬ ‫بعد‬ ■‫باستخدامها‬ ‫أخرى‬ ‫رؤية‬ ‫إنشاء‬ ‫حتى‬ ‫أو‬ ■ create view v as < query expression > – create view faculty as select ID, name, dept_name from instructor; – select name from faculty where dept_name = ‘Biology’; – create view bio_faculty as select * from faculty where dept_name = ‘Biology’; 2020 By Eng. Joud Khattab
  • 50. Transaction (‫المداولة‬ ‫)مفهوم‬ ■ Commit (‫تثبيت‬ ‫)تعليمات‬ ■ Rollback (‫إلغاء‬ ‫)تعليمات‬ ■‫تعليمات‬DDLً‫تلقائيا‬ ‫بالتثبيت‬ ‫تقوم‬. 2020 By Eng. Joud Khattab
  • 51. ‫أخرى‬ ‫معطيات‬ ‫أنماط‬ ■ Date: – day, month, year ‘2005-7-27’ ■ Time: – hours, minutes, seconds ‘09:00:30’, ‘09:00:30.75’ ■ Timestamp: – date + time ‘2005-7-27 09:00:30.75’ ■ interval period of time: – timestamp1- timestamp2 ■ Blob: – binary large object (image, sound, movie, …) ■ Clob: – character large object (memo, text book, …) 2020 By Eng. Joud Khattab
  • 52. Question 1 ■ The attributes made up of more than one single attributes are called: A. Derived attribute B. Composite attribute C. Single value attribute D. Multi value attribute 2020 By Eng. Joud Khattab
  • 53. Question 1 ■ The attributes made up of more than one single attributes are called: A. Derived attribute B. Composite attribute C. Single value attribute D. Multi value attribute 2020 By Eng. Joud Khattab
  • 54. Question 2 ■ Operations such as “and”. The result of: true and unknown is _____ false and unknown is _____ unknown and unknown is _____ A. Unknown, unknown, false B. True, false, unknown C. True, unknow, unknown D. Unknown, false, unknown 2020 By Eng. Joud Khattab
  • 55. Question 2 ■ Operations such as “and”. The result of: true and unknown is _____ false and unknown is _____ unknown and unknown is _____ A. Unknown, unknown, false B. True, false, unknown C. True, unknow, unknown D. Unknown, false, unknown 2020 By Eng. Joud Khattab
  • 56. Question 3 ■ Using the _____ clause retains only one copy of such identical tuples. A. Null B. Unique C. Not null D. Distinct 2020 By Eng. Joud Khattab
  • 57. Question 3 ■ Using the _____ clause retains only one copy of such identical tuples. A. Null B. Unique C. Not null D. Distinct 2020 By Eng. Joud Khattab
  • 58. Question 4 ■ In an employee table to include the attributes whose “value always have some value” which of the following constraint must be used? A. Null B. Not null C. Unique D. Distinct 2020 By Eng. Joud Khattab
  • 59. Question 4 ■ In an employee table to include the attributes whose “value always have some value” which of the following constraint must be used? A. Null B. Not null C. Unique D. Distinct 2020 By Eng. Joud Khattab
  • 60. Question 5 ■ Aggregate functions are functions that take a _____ as input and return a single value. A. Collection of values B. Single value C. Aggregate value D. Both collection of values & single value 2020 By Eng. Joud Khattab
  • 61. Question 5 ■ Aggregate functions are functions that take a _____ as input and return a single value. A. Collection of values B. Single value C. Aggregate value D. Both collection of values & single value 2020 By Eng. Joud Khattab
  • 62. Question 6 ■ All aggregate functions except _____ ignore null values in their input collection. A. Count(attribute) B. Count(*) C. Avg D. Sum 2020 By Eng. Joud Khattab
  • 63. Question 6 ■ All aggregate functions except _____ ignore null values in their input collection. A. Count(attribute) B. Count(*) C. Avg D. Sum 2020 By Eng. Joud Khattab
  • 64. Question 7 ■ Aggregate functions can be used in the select list or the _____ clause of a select statement or subquery. They cannot be used in a _____ clause. A. Where, having B. Having, where C. Group by, having D. Group by, where 2020 By Eng. Joud Khattab
  • 65. Question 7 ■ Aggregate functions can be used in the select list or the _____ clause of a select statement or subquery. They cannot be used in a _____ clause. A. Where, having B. Having, where C. Group by, having D. Group by, where 2020 By Eng. Joud Khattab
  • 66. Question 8 ■ Which of the following deletes all the entries but keeps the structure of the relation. A. Delete from r where P; B. Delete from instructor where dept name = ‘Finance’; C. Delete from instructor where salary between 13000 and 15000; D. Delete from instructor; 2020 By Eng. Joud Khattab
  • 67. Question 8 ■ Which of the following deletes all the entries but keeps the structure of the relation. A. Delete from r where P; B. Delete from instructor where dept name = ‘Finance’; C. Delete from instructor where salary between 13000 and 15000; D. Delete from instructor; 2020 By Eng. Joud Khattab
  • 68. Question 9 ■ Fill in with correct keyword to update the instructor relation Update instructor _____ salary = salary * 1.05; A. Where B. Set C. In D. select 2020 By Eng. Joud Khattab
  • 69. Question 9 ■ Fill in with correct keyword to update the instructor relation Update instructor _____ salary = salary * 1.05; A. Where B. Set C. In D. select 2020 By Eng. Joud Khattab
  • 70. Question 10 ■ Which of the join operations do not preserve non matched tuples? A. Left outer join B. Right outer join C. Inner join D. Natural join 2020 By Eng. Joud Khattab
  • 71. Question 10 ■ Which of the join operations do not preserve non matched tuples? A. Left outer join B. Right outer join C. Inner join D. Natural join 2020 By Eng. Joud Khattab
  • 72. Question 11 ■ How many tables may be included with a join? A. One B. Two C. Three D. All of the mentioned 2020 By Eng. Joud Khattab
  • 73. Question 11 ■ How many tables may be included with a join? A. One B. Two C. Three D. All of the mentioned 2020 By Eng. Joud Khattab
  • 74. Question 12 ■ Data integrity constraints are used to: A. Control who is allowed access to the data B. Ensure that duplicate records are not entered into the table C. Improve the quality of data entered for a specific property D. Prevent users from changing the values stored in the table 2020 By Eng. Joud Khattab
  • 75. Question 12 ■ Data integrity constraints are used to: A. Control who is allowed access to the data B. Ensure that duplicate records are not entered into the table C. Improve the quality of data entered for a specific property D. Prevent users from changing the values stored in the table 2020 By Eng. Joud Khattab
  • 76. Question 13 ■ In order to ensure that an instructor’s salary domain allows only values greater than a specified value use: A. Value >= 30000.00 B. Not null; C. Check(value >= 29000.00); D. Check(value) 2020 By Eng. Joud Khattab
  • 77. Question 13 ■ In order to ensure that an instructor’s salary domain allows only values greater than a specified value use: A. Value >= 30000.00 B. Not null; C. Check(value >= 29000.00); D. Check(value) 2020 By Eng. Joud Khattab
  • 78. Question 14 ■ Which of the following statement is used to remove the privilege from the user Amir? A. Remove update on department from Amir B. Revoke update on employee from Amir C. Delete select on department from Raj D. Grant update on employee from Amir 2020 By Eng. Joud Khattab
  • 79. Question 14 ■ Which of the following statement is used to remove the privilege from the user Amir? A. Remove update on department from Amir B. Revoke update on employee from Amir C. Delete select on department from Raj D. Grant update on employee from Amir 2020 By Eng. Joud Khattab
  • 80. Question 15 ■ Which of the following is another name for a weak entity? A. Child B. Owner C. Dominant D. All of the mentioned 2020 By Eng. Joud Khattab
  • 81. Question 15 ■ Which of the following is another name for a weak entity? A. Child B. Owner C. Dominant D. All of the mentioned 2020 By Eng. Joud Khattab
  • 82. Question 16 ■ E-R model uses which symbol to represent weak entity set: A. Dotted rectangle B. Diamond C. Doubly outlined rectangle D. None of the above 2020 By Eng. Joud Khattab
  • 83. Question 16 ■ E-R model uses which symbol to represent weak entity set: A. Dotted rectangle B. Diamond C. Doubly outlined rectangle D. None of the above 2020 By Eng. Joud Khattab
  • 84. XML 2020 By Eng. Joud Khattab
  • 85. XML ■ Structure – Elements and Attributes – Namespaces – DTD – XML Schema ■ Query – XPath – XQuery (FLOWER) – XSLT 2020 By Eng. Joud Khattab
  • 86. XML Introduction ■ XML (eXtensible Markup Language) ■ semi-structured data models. ■ Derived from SGML (Standard Generalized Markup Language) ■ Documents have tags giving extra information about sections of the document – <title> XML </title> <slide> Introduction …</slide> ■ Extensible, unlike HTML Users can add new tags. ■ The ability to specify new tags, and to create nested tag structures make XML a great way to exchange data, not just documents. ■ Elements must be properly nested 2020 By Eng. Joud Khattab
  • 87. XML Namespaces ■ Usage: – XML data has to be exchanged between organizations. – Same tag name may have different meaning in different organizations, causing confusion on exchanged documents. ■ Example: <university xmlns:yale=“http://www.yale.edu”> … <yale:course> <yale:course_id> CS-101 </yale:course_id> <yale:title> Intro. to Computer Science</yale:title> <yale:dept_name> Comp. Sci. </yale:dept_name> <yale:credits> 4 </yale:credits> </yale:course> … </university> 2020 By Eng. Joud Khattab
  • 88. XML (DTD) Document Type Definition ■ The type of an XML document can be specified using a DTD ■ DTD constraints structure of XML data – What elements can occur – What attributes can/must an element have – What subelements can/must occur inside each element, and how many times. ■ DTD does not constrain data types – All values represented as strings in XML ■ DTD syntax – <!ELEMENT element (subelements-specification) > – <!ATTLIST element (attributes) > 2020 By Eng. Joud Khattab
  • 89. XML Schema ■ XML Schema is a more sophisticated schema language which addresses the drawbacks of DTDs. ■ Supports: – Typing of values ■ integer, string, etc ■ constraints on min/max values – User-defined, complex types – Many more features, including ■ uniqueness and foreign key constraints, inheritance 2020 By Eng. Joud Khattab
  • 90. XML XPath ■ XPath is used to address (select) parts of documents using path expressions ■ A path expression is a sequence of steps separated by “/” ■ Examples: – /university-3/instructor/name ■ <name>Srinivasan</name> ■ <name>Brandt</name> – /university-3/instructor/name/text( ) ■ returns the same names, but without the enclosing tags – /university-3/course[credits >= 4] ■ returns course elements with a credit value greater or equal 4 – /university-3/course[credits >= 4]/@course_id ■ returns the course identifiers of courses with credits >= 4 2020 By Eng. Joud Khattab
  • 91. XML XQuery ■ XQuery is a general purpose query language for XML data ■ XQuery uses a for … let … where … order by … return… ■ Syntax – For <--> SQL from – Where <--> SQL where – order by <--> SQL order by – return <--> SQL select – let allows temporary variables, and has no equivalent in SQL 2020 By Eng. Joud Khattab
  • 92. XML XQuery FLWOR Syntax ■ Examples: – find all courses with credits > 3, with each result enclosed in an <course_id> .. </course_id> tag for $x in /university-3/course let $courseId := $x/@course_id where $x/credits > 3 return <course_id> { $courseId } </course id> ■ Items in the return clause are XML text unless enclosed in {}, in which case they are evaluated 2020 By Eng. Joud Khattab
  • 93. Question 1 ■ What does XML stand for? A. eXtra Modern Link B. eXtensible Markup Language C. Example Markup Language D. X-Markup Language 2020 By Eng. Joud Khattab
  • 94. Question 1 ■ What does XML stand for? A. eXtra Modern Link B. eXtensible Markup Language C. Example Markup Language D. X-Markup Language 2020 By Eng. Joud Khattab
  • 95. Question 2 ■ What is the correct syntax of the declaration which defines the XML version? A. <xml version=“1.0”/> B. <?xml version=“1.0”?> C. <?xml version=“1.0”/> D. None of the above 2020 By Eng. Joud Khattab
  • 96. Question 2 ■ What is the correct syntax of the declaration which defines the XML version? A. <xml version=“1.0”/> B. <?xml version=“1.0”?> C. <?xml version=“1.0”/> D. None of the above 2020 By Eng. Joud Khattab
  • 97. Question 3 ■ Is it easier to process XML than HTML? A. Yes B. No C. Sometimes D. Cant say 2020 By Eng. Joud Khattab
  • 98. Question 3 ■ Is it easier to process XML than HTML? A. Yes B. No C. Sometimes D. Cant say 2020 By Eng. Joud Khattab
  • 99. Question 4 ■ Kind of Parsers are A. Well-formed B. Well-documented C. Non-validating and validating D. None of the above 2020 By Eng. Joud Khattab
  • 100. Question 4 ■ Kind of Parsers are A. Well-formed B. Well-documented C. Non-validating and validating D. None of the above 2020 By Eng. Joud Khattab
  • 101. Question 5 ■ Well formed XML document means A. It contains a root element B. It contain an element C. It contains one or more elements D. Must contain one or more elements and root element must contain all other elements 2020 By Eng. Joud Khattab
  • 102. Question 5 ■ Well formed XML document means A. It contains a root element B. It contain an element C. It contains one or more elements D. Must contain one or more elements and root element must contain all other elements 2020 By Eng. Joud Khattab
  • 103. Question 6 ■ Comment in XML document is given by A. <?-- --> B. <!-- --!> C. <!-- --> D. </-- --> 2020 By Eng. Joud Khattab
  • 104. Question 6 ■ Comment in XML document is given by A. <?-- --> B. <!-- --!> C. <!-- --> D. </-- --> 2020 By Eng. Joud Khattab
  • 105. Question 7 ■ XML uses the features of A. HTML B. XHTML C. VML D. SGML 2020 By Eng. Joud Khattab
  • 106. Question 7 ■ XML uses the features of A. HTML B. XHTML C. VML D. SGML 2020 By Eng. Joud Khattab
  • 107. Question 8 ■ What does DTD stand for? A. Direct Type Definition B. Document Type Definition C. Dynamic Type Definition 2020 By Eng. Joud Khattab
  • 108. Question 8 ■ What does DTD stand for? A. Direct Type Definition B. Document Type Definition C. Dynamic Type Definition 2020 By Eng. Joud Khattab
  • 109. Question 9 ■ Which of the following XML fragments are well-formed? A. <myElement myAttribute=“someValue”/> B. <myElement myAttribute=someValue/> C. <myElement myAttribute=‘someValue’/> D. <myElement myAttribute=“someValue’/> 2020 By Eng. Joud Khattab
  • 110. Question 9 ■ Which of the following XML fragments are well-formed? A. <myElement myAttribute=“someValue”/> B. <myElement myAttribute=someValue/> C. <myElement myAttribute=‘someValue’/> D. <myElement myAttribute=“someValue’/> 2020 By Eng. Joud Khattab
  • 111. Question 10 ■ How can we make attributes have multiple values: A. <myElement myAttribute=“value1 value2”/> B. <myElement myAttribute=“value1” myAttribute=“value2”/> C. <myElement myAttribute=“value1,value2”/> D. Attributes cannot have multiple values 2020 By Eng. Joud Khattab
  • 112. Question 10 ■ How can we make attributes have multiple values: A. <myElement myAttribute=“value1 value2”/> B. <myElement myAttribute=“value1” myAttribute=“value2”/> C. <myElement myAttribute=“value1,value2”/> D. Attributes cannot have multiple values 2020 By Eng. Joud Khattab
  • 113. Question 11 ■ In XML A. The internal DTD subset is read before the external DTD B. The external DTD subset is read before the internal DTD C. There is no external type of DTD D. There is no internal type of DTD 2020 By Eng. Joud Khattab
  • 114. Question 11 ■ In XML A. The internal DTD subset is read before the external DTD B. The external DTD subset is read before the internal DTD C. There is no external type of DTD D. There is no internal type of DTD 2020 By Eng. Joud Khattab
  • 115. Question 12 ■ Is this a “well formed” XML document? <?xml version=“1.0”?> <note> <to age=29>Tove</to> <from>Jani</from> </note> A. True B. False 2020 By Eng. Joud Khattab
  • 116. Question 12 ■ Is this a “well formed” XML document? <?xml version=“1.0”?> <note> <to age=29>Tove</to> <from>Jani</from> </note> A. True B. False 2020 By Eng. Joud Khattab
  • 117. Question 13 ■ XML preserves white spaces A. True B. False 2020 By Eng. Joud Khattab
  • 118. Question 13 ■ XML preserves white spaces A. True B. False 2020 By Eng. Joud Khattab
  • 119. NORMALIZATION 2020 By Eng. Joud Khattab
  • 121. Normalization Process ■ Every table in your Database should at least follow the 1st Normal Form, always. ■ Or stop using Database!! 2020 By Eng. Joud Khattab
  • 122. 1st Normal Form ■ There are 4 basic rules that a table should follow to be in 1st Normal Form. 2020 By Eng. Joud Khattab
  • 123. 1st Normal Form Rule 1 ■ Each column should contain atomic values. ■ Entries like X,Y and W,X violate this rule. 2020 By Eng. Joud Khattab
  • 124. 1st Normal Form Rule 2 ■ A column should contain values that are of the same type. ■ Do not inter-mix different types of values in any column. 2020 By Eng. Joud Khattab
  • 125. 1st Normal Form Rule 3 ■ Each column should have a unique name. ■ Same names leads to confusion at the time of data retrieval. 2020 By Eng. Joud Khattab
  • 126. 1st Normal Form Rule 4 ■ Order in which data is saved doesn’t matter. ■ Using SQL query. You can easily fetch data in any order from a table. 2020 By Eng. Joud Khattab
  • 127. 1st Normal Form Example 2020 By Eng. Joud Khattab
  • 128. 1st Normal Form Example 2020 By Eng. Joud Khattab
  • 129. 1st Normal Form Example 2020 By Eng. Joud Khattab
  • 130. 2nd Normal Form ■ For a table to be in the Second Normal Form: – It should be in 1st Normal Form. – And, it should not have any Partial Dependencies. 2020 By Eng. Joud Khattab
  • 131. 2nd Normal Form What is Partial Dependency? ■ To understand Partial Dependency. ■ We first need to understand what Dependency is? 2020 By Eng. Joud Khattab
  • 132. 2nd Normal Form What is Partial Dependency? 2020 By Eng. Joud Khattab
  • 133. 2nd Normal Form What is Partial Dependency? 2020 By Eng. Joud Khattab
  • 134. 2nd Normal Form What is Partial Dependency? ■ Primary Key should be score_id ■ But student_id + subject_id together makes a more meaningful primary key. 2020 By Eng. Joud Khattab
  • 135. 2nd Normal Form What is Partial Dependency? 2020 By Eng. Joud Khattab
  • 136. 2nd Normal Form What is Partial Dependency? 2020 By Eng. Joud Khattab
  • 137. 2nd Normal Form This is Partial Dependency Teacher column only depends on subject and not on student. 2020 By Eng. Joud Khattab
  • 138. 2nd Normal Form This is Partial Dependency Move teacher column to Subject table 2020 By Eng. Joud Khattab
  • 139. 2nd Normal Form This is Partial Dependency 2020 By Eng. Joud Khattab
  • 140. 2nd Normal Form This is Partial Dependency 2020 By Eng. Joud Khattab
  • 141. 2nd Normal Form 2020 By Eng. Joud Khattab
  • 142. 3rd Normal Form 2020 By Eng. Joud Khattab
  • 143. 3rd Normal Form ■ For a table to be in 3rd Normal Form: – It should be in 2nd Normal Form. – And it should not have Transitive Dependency. 2020 By Eng. Joud Khattab
  • 144. 3rd Normal Form 2020 By Eng. Joud Khattab
  • 145. 3rd Normal Form 2020 By Eng. Joud Khattab
  • 146. 3rd Normal Form 2020 By Eng. Joud Khattab
  • 147. 3.5 Normal Form (BCNF) Boyce-Codd Normal Form ■ Tables should satisfy 2 conditions: – It should be in the 3rd Normal Form. – For any dependency A → B, A should be a super key. 2020 By Eng. Joud Khattab
  • 148. 3.5 Normal Form (BCNF) Boyce-Codd Normal Form 2020 By Eng. Joud Khattab
  • 149. 3.5 Normal Form (BCNF) Boyce-Codd Normal Form 2020 By Eng. Joud Khattab
  • 150. 3.5 Normal Form (BCNF) Boyce-Codd Normal Form 2020 By Eng. Joud Khattab
  • 151. 4th Normal Form ■ It should satisfy BCNF. ■ It should not have Multi-Valued Dependency. 2020 By Eng. Joud Khattab
  • 152. 4th Normal Form 2020 By Eng. Joud Khattab
  • 153. 4th Normal Form 2020 By Eng. Joud Khattab
  • 154. 4th Normal Form 2 independent tables 2020 By Eng. Joud Khattab
  • 155. Question 1 ■ In the _____ normal form, a composite attribute is converted to individual attributes. A. First B. Second C. Third D. Fourth 2020 By Eng. Joud Khattab
  • 156. Question 1 ■ In the _____ normal form, a composite attribute is converted to individual attributes. A. First B. Second C. Third D. Fourth 2020 By Eng. Joud Khattab
  • 157. Question 2 ■ Tables in second normal form (2NF) A. Eliminate all hidden dependencies B. Eliminate the possibility of a insertion anomalies C. Have a composite key D. Have all non key fields depend on the whole primary key 2020 By Eng. Joud Khattab
  • 158. Question 2 ■ Tables in second normal form (2NF) A. Eliminate all hidden dependencies B. Eliminate the possibility of a insertion anomalies C. Have a composite key D. Have all non key fields depend on the whole primary key 2020 By Eng. Joud Khattab
  • 159. Question 3 ■ Which forms are based on the concept of functional dependency A. 1NF B. 2NF C. 3NF D. 4NF 2020 By Eng. Joud Khattab
  • 160. Question 3 ■ Which forms are based on the concept of functional dependency A. 1NF B. 2NF C. 3NF D. 4NF 2020 By Eng. Joud Khattab
  • 161. RATIONAL ALGEBRA 2020 By Eng. Joud Khattab
  • 162. Question 1 ■ If E1 and E2 are relational algebra expressions, then which of the following is NOT a relational algebra expression? A. E1 ∪ E2 B. E1 / E2 C. E1 – E2 D. E1 x E2 2020 By Eng. Joud Khattab
  • 163. Question 1 ■ If E1 and E2 are relational algebra expressions, then which of the following is NOT a relational algebra expression? A. E1 ∪ E2 B. E1 / E2 C. E1 – E2 D. E1 x E2 2020 By Eng. Joud Khattab
  • 164. Question 2 ■ Which clause from the following corresponds to the projection operation of the relational algebra? A. From B. Select C. Where D. Group by 2020 By Eng. Joud Khattab
  • 165. Question 2 ■ Which clause from the following corresponds to the projection operation of the relational algebra? A. From B. Select C. Where D. Group by 2020 By Eng. Joud Khattab
  • 166. MCQ 2020 By Eng. Joud Khattab
  • 167. Question 1 ■ A relational database consists of a collection of A. Tables B. Fields C. Records D. Keys 2020 By Eng. Joud Khattab
  • 168. Question 1 ■ A relational database consists of a collection of A. Tables B. Fields C. Records D. Keys 2020 By Eng. Joud Khattab
  • 169. Question 2 ■ The term _______ is used to refer to a row. A. Attribute B. Tuple C. Field D. Instance 2020 By Eng. Joud Khattab
  • 170. Question 2 ■ The term _______ is used to refer to a row. A. Attribute B. Tuple C. Field D. Instance 2020 By Eng. Joud Khattab
  • 171. Question 3 ■ The term attribute refers to a ___________ of a table. A. Record B. Column C. Tuple D. Key 2020 By Eng. Joud Khattab
  • 172. Question 3 ■ The term attribute refers to a ___________ of a table. A. Record B. Column C. Tuple D. Key 2020 By Eng. Joud Khattab
  • 173. Question 4 ■ Database __________ which is the logical design of the database, and the database _______ which is a snapshot of the data in the database at a given instant in time. A. Instance, Schema B. Relation, Schema C. Relation, Domain D. Schema, Instance 2020 By Eng. Joud Khattab
  • 174. Question 4 ■ Database __________ which is the logical design of the database, and the database _______ which is a snapshot of the data in the database at a given instant in time. A. Instance, Schema B. Relation, Schema C. Relation, Domain D. Schema, Instance 2020 By Eng. Joud Khattab
  • 175. Question 5 ■ Course (course_id,sec_id,semester) Here the course_id,sec_id and semester are __________ and course is a _________ A. Relations, Attribute B. Attributes, Relation C. Tuple, Relation D. Tuple, Attributes 2020 By Eng. Joud Khattab
  • 176. Question 5 ■ Course (course_id,sec_id,semester) Here the course_id,sec_id and semester are __________ and course is a _________ A. Relations, Attribute B. Attributes, Relation C. Tuple, Relation D. Tuple, Attributes 2020 By Eng. Joud Khattab
  • 177. Question 6 ■ The tuples of the relations can be of ________ order A. Any B. Same C. Sorted D. Constant 2020 By Eng. Joud Khattab
  • 178. Question 6 ■ The tuples of the relations can be of ________ order A. Any B. Same C. Sorted D. Constant 2020 By Eng. Joud Khattab
  • 179. Question 7 ■ Which one of the following attribute can be taken as a primary key ? A. Name B. Street C. Id D. Department 2020 By Eng. Joud Khattab
  • 180. Question 7 ■ Which one of the following attribute can be taken as a primary key ? A. Name B. Street C. Id D. Department 2020 By Eng. Joud Khattab
  • 181. Question 8 ■ The ______ is the one in which the primary key of one relation is used as a normal attribute in another relation. A. Referential relation B. Referencing relation C. Referenced relation D. Referred relation 2020 By Eng. Joud Khattab
  • 182. Question 8 ■ The ______ is the one in which the primary key of one relation is used as a normal attribute in another relation. A. Referential relation B. Referencing relation C. Referenced relation D. Referred relation 2020 By Eng. Joud Khattab
  • 183. Question 9 ■ The _____ operation allows the combining of two relations by merging pairs of tuples, one from each relation, into a single tuple A. Select B. Join C. Union D. Intersection 2020 By Eng. Joud Khattab
  • 184. Question 9 ■ The _____ operation allows the combining of two relations by merging pairs of tuples, one from each relation, into a single tuple A. Select B. Join C. Union D. Intersection 2020 By Eng. Joud Khattab
  • 185. Question 10 ■ The result which operation contains all pairs of tuples from the two relations, regardless of whether their attribute values match A. Join B. Cartesian product C. Intersection D. Set difference 2020 By Eng. Joud Khattab
  • 186. Question 10 ■ The result which operation contains all pairs of tuples from the two relations, regardless of whether their attribute values match A. Join B. Cartesian product C. Intersection D. Set difference 2020 By Eng. Joud Khattab
  • 187. Question 11 ■ The _______ operation performs a set union of two “similarly structured” tables A. Union B. Join C. Product D. Intersect 2020 By Eng. Joud Khattab
  • 188. Question 11 ■ The _______ operation performs a set union of two “similarly structured” tables A. Union B. Join C. Product D. Intersect 2020 By Eng. Joud Khattab
  • 189. Question 12 ■ The _______ operator takes the results of two queries and returns only rows that appear in both result sets A. Union B. Intersect C. Difference D. Projection 2020 By Eng. Joud Khattab
  • 190. Question 12 ■ The _______ operator takes the results of two queries and returns only rows that appear in both result sets A. Union B. Intersect C. Difference D. Projection 2020 By Eng. Joud Khattab
  • 191. Question 13 ■ Which one of the following is used to define the structure of the relation ,deleting relations and relating schemas ? A. DML (Data Manipulation Language) B. DDL (Data Definition Language) C. Query D. Relational Schema 2020 By Eng. Joud Khattab
  • 192. Question 13 ■ Which one of the following is used to define the structure of the relation ,deleting relations and relating schemas ? A. DML (Data Manipulation Language) B. DDL (Data Definition Language) C. Query D. Relational Schema 2020 By Eng. Joud Khattab
  • 193. Question 14 ■ Which one of the following provides the ability to query information from the database and to insert tuples into, delete tuples from, and modify tuples in the database ? A. DML (Data Manipulation Language) B. DDL (Data Definition Language) C. Query D. Relational Schema 2020 By Eng. Joud Khattab
  • 194. Question 14 ■ Which one of the following provides the ability to query information from the database and to insert tuples into, delete tuples from, and modify tuples in the database ? A. DML (Data Manipulation Language) B. DDL (Data Definition Language) C. Query D. Relational Schema 2020 By Eng. Joud Khattab
  • 195. Question 15 ■ The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character. A. Fixed, equal B. Equal, variable C. Fixed, variable D. Variable, equal 2020 By Eng. Joud Khattab
  • 196. Question 15 ■ The basic data type char(n) is a _____ length character string and varchar(n) is _____ length character. A. Fixed, equal B. Equal, variable C. Fixed, variable D. Variable, equal 2020 By Eng. Joud Khattab
  • 197. Question 16 ■ Insert into instructor values (10211, ’Smith’, ’Biology’, 66000); What type of statement is this ? A. Query B. DML C. Relational D. DDL 2020 By Eng. Joud Khattab
  • 198. Question 16 ■ Insert into instructor values (10211, ’Smith’, ’Biology’, 66000); What type of statement is this ? A. Query B. DML C. Relational D. DDL 2020 By Eng. Joud Khattab
  • 199. Question 17 ■ Select ________ dept_name from instructor; Here which of the following displays the unique values of the column ? A. All B. From C. Distinct D. Name 2020 By Eng. Joud Khattab
  • 200. Question 17 ■ Select ________ dept_name from instructor; Here which of the following displays the unique values of the column ? A. All B. From C. Distinct D. Name 2020 By Eng. Joud Khattab
  • 201. Question 18 ■ The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate A. Where, from B. From, select C. Select, from D. From, where 2020 By Eng. Joud Khattab
  • 202. Question 18 ■ The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate A. Where, from B. From, select C. Select, from D. From, where 2020 By Eng. Joud Khattab
  • 203. Question 19 ■ Which of the following statements contains an error? A. Select * from emp where emp id = 10003; B. Select empid from emp where lastname = GELLER; C. Select emp id from emp; D. Select empid where empid = 1009 and lastname = ‘GELLER’; 2020 By Eng. Joud Khattab
  • 204. Question 19 ■ Which of the following statements contains an error? A. Select * from emp where emp id = 10003; B. Select empid from emp where lastname = GELLER; C. Select emp id from emp; D. Select empid where empid = 1009 and lastname = ‘GELLER’; 2020 By Eng. Joud Khattab
  • 205. Question 20 ■ Which keyword must be used here to rename the field name ? A. From B. Rename C. As D. Join 2020 By Eng. Joud Khattab
  • 206. Question 20 ■ Which keyword must be used here to rename the field name ? A. From B. Rename C. As D. Join 2020 By Eng. Joud Khattab
  • 207. Question 21 ■ SELECT * FROM employee WHERE dept_name="Comp Sci"; ■ In the SQL given above there is an error . Identify the error A. Dept_name B. Employee C. “Comp Sci” D. From 2020 By Eng. Joud Khattab
  • 208. Question 21 ■ SELECT * FROM employee WHERE dept_name="Comp Sci"; ■ In the SQL given above there is an error . Identify the error A. Dept_name B. Employee C. “Comp Sci” D. From 2020 By Eng. Joud Khattab
  • 209. Question 22 ■ SELECT emp_name FROM department ■ WHERE dept_name LIKE ’ __ Computer Science’; ■ Which one of the following has to be added into the blank to select the dept_name which has Computer Science as its ending string ? A. % B. _ C. || D. $ 2020 By Eng. Joud Khattab
  • 210. Question 22 ■ SELECT emp_name FROM department ■ WHERE dept_name LIKE ’ __ Computer Science’; ■ Which one of the following has to be added into the blank to select the dept_name which has Computer Science as its ending string ? A. % B. _ C. || D. $ 2020 By Eng. Joud Khattab
  • 211. Question 23 ■ ’_ _ _ ’ matches any string of ______ three characters. ■ ’_ _ _ %’ matches any string of ______ three characters. A. At least, Exactly B. Exactly, At least C. At least, All D. All, Exactly 2020 By Eng. Joud Khattab
  • 212. Question 23 ■ ’_ _ _ ’ matches any string of ______ three characters. ■ ’_ _ _ %’ matches any string of ______ three characters. A. At least, Exactly B. Exactly, At least C. At least, All D. All, Exactly 2020 By Eng. Joud Khattab
  • 213. Question 24 ■ By default, the order by clause lists items in ______ order. A. Descending B. Any C. Same D. Ascending 2020 By Eng. Joud Khattab
  • 214. Question 24 ■ By default, the order by clause lists items in ______ order. A. Descending B. Any C. Same D. Ascending 2020 By Eng. Joud Khattab
  • 215. Question 25 ■ To display the salary from greater to smaller and name in ascending order which of the following options should be used? A. Ascending, Descending B. Asc, Desc C. Desc, Asc D. Descending, Ascending 2020 By Eng. Joud Khattab
  • 216. Question 25 ■ To display the salary from greater to smaller and name in ascending order which of the following options should be used? A. Ascending, Descending B. Asc, Desc C. Desc, Asc D. Descending, Ascending 2020 By Eng. Joud Khattab
  • 217. Question 26 ■ SELECT instructor.* ■ FROM instructor, teaches ■ WHERE instructor.ID= teaches.ID; ■ This query does which of the following operation? A. All attributes of instructor and teaches are selected B. All attributes of instructor are selected on the given condition C. All attributes of teaches are selected on given condition D. Only the some attributes from instructed and teaches are selected 2020 By Eng. Joud Khattab
  • 218. Question 26 ■ SELECT instructor.* ■ FROM instructor, teaches ■ WHERE instructor.ID= teaches.ID; ■ This query does which of the following operation? A. All attributes of instructor and teaches are selected B. All attributes of instructor are selected on the given condition C. All attributes of teaches are selected on given condition D. Only the some attributes from instructed and teaches are selected 2020 By Eng. Joud Khattab
  • 219. Question 27 ■ In SQL the spaces at the end of the string are removed by _______ function A. Upper B. String C. Trim D. Lower 2020 By Eng. Joud Khattab
  • 220. Question 27 ■ In SQL the spaces at the end of the string are removed by _______ function A. Upper B. String C. Trim D. Lower 2020 By Eng. Joud Khattab
  • 221. Question 28 ■ _____ operator is used for appending two strings A. & B. % C. || D. _ 2020 By Eng. Joud Khattab
  • 222. Question 28 ■ _____ operator is used for appending two strings A. & B. % C. || D. _ 2020 By Eng. Joud Khattab
  • 223. Question 29 ■ The union operation automatically __________ unlike the select clause A. Adds tuples B. Eliminates unique tuples C. Adds common tuples D. Eliminates duplicate 2020 By Eng. Joud Khattab
  • 224. Question 29 ■ The union operation automatically __________ unlike the select clause. A. Adds tuples B. Eliminates unique tuples C. Adds common tuples D. Eliminates duplicate 2020 By Eng. Joud Khattab
  • 225. Question 30 ■ The predicate in a where clause can involve Boolean operations such as and ■ The result of: true and unknown is _____ false and unknown is _____ unknown and unknown is _____ A. Unknown, unknown, false B. True, false, unknown C. True, unknown, unknown D. Unknown, false, unknown 2020 By Eng. Joud Khattab
  • 226. Question 30 ■ The predicate in a where clause can involve Boolean operations such as and ■ The result of: true and unknown is _____ false and unknown is _____ unknown and unknown is _____ A. Unknown, unknown, false B. True, false, unknown C. True, unknown, unknown D. Unknown, false, unknown 2020 By Eng. Joud Khattab
  • 227. Question 31 ■ Using the ______ clause retains only one copy of such identical tuples A. Null B. Unique C. Not null D. Distinct 2020 By Eng. Joud Khattab
  • 228. Question 31 ■ Using the ______ clause retains only one copy of such identical tuples A. Null B. Unique C. Not null D. Distinct 2020 By Eng. Joud Khattab
  • 229. Question 32 ■ In an employee table to include the attributes whose value always have some value which of the following constraint must be used? A. Null B. Not null C. Unique D. Distinct 2020 By Eng. Joud Khattab
  • 230. Question 32 ■ In an employee table to include the attributes whose value always have some value which of the following constraint must be used? A. Null B. Not null C. Unique D. Distinct 2020 By Eng. Joud Khattab
  • 231. Question 33 ■ Aggregate functions are functions that take a ___________ as input and return a single value A. Collection of values B. Single value C. Aggregate value D. Both Collection of values & Single value 2020 By Eng. Joud Khattab
  • 232. Question 33 ■ Aggregate functions are functions that take a ___________ as input and return a single value A. Collection of values B. Single value C. Aggregate value D. Both Collection of values & Single value 2020 By Eng. Joud Khattab
  • 233. Question 34 ■ All aggregate functions except _____ ignore null values in their input collection. A. Count(attribute) B. Count(*) C. Avg D. Sum 2020 By Eng. Joud Khattab
  • 234. Question 34 ■ All aggregate functions except _____ ignore null values in their input collection. A. Count(attribute) B. Count(*) C. Avg D. Sum 2020 By Eng. Joud Khattab
  • 235. Question 35 ■ Aggregate functions can be used in the select list or the _______ clause of a select statement or subquery. They cannot be used in a ______ clause. A. Where, having B. Having, where C. Group by, having D. Group by, where 2020 By Eng. Joud Khattab
  • 236. Question 35 ■ Aggregate functions can be used in the select list or the _______ clause of a select statement or subquery. They cannot be used in a ______ clause. A. Where, having B. Having, where C. Group by, having D. Group by, where 2020 By Eng. Joud Khattab
  • 237. Question 36 ■ Which one of the following deletes all the entries but keeps the structure of the relation. A. Delete from r where P; B. Delete from instructor where dept name= ’Finance’; C. Delete from instructor where salary between 13000 and 15000; D. Delete from instructor; 2020 By Eng. Joud Khattab
  • 238. Question 36 ■ Which one of the following deletes all the entries but keeps the structure of the relation. A. Delete from r where P; B. Delete from instructor where dept name= ’Finance’; C. Delete from instructor where salary between 13000 and 15000; D. Delete from instructor; 2020 By Eng. Joud Khattab
  • 239. Question 37 ■ UPDATE instructor _____ salary= salary * 1.05; ■ Fill in with correct keyword to update the instructor relation. A. Where B. Set C. In D. Select 2020 By Eng. Joud Khattab
  • 240. Question 37 ■ UPDATE instructor _____ salary= salary * 1.05; ■ Fill in with correct keyword to update the instructor relation. A. Where B. Set C. In D. Select 2020 By Eng. Joud Khattab
  • 241. Question 38 ■ Which of the join operations do not preserve non matched tuples? A. Left outer join B. Right outer join C. Inner join D. Natural join 2020 By Eng. Joud Khattab
  • 242. Question 38 ■ Which of the join operations do not preserve non matched tuples? A. Left outer join B. Right outer join C. Inner join D. Natural join 2020 By Eng. Joud Khattab
  • 243. Question 39 ■ How many tables may be included with a join? A. One B. Two C. Three D. All of the mentioned 2020 By Eng. Joud Khattab
  • 244. Question 39 ■ How many tables may be included with a join? A. One B. Two C. Three D. All of the mentioned 2020 By Eng. Joud Khattab
  • 245. Question 40 ■ Data integrity constraints are used to: A. Control who is allowed access to the data B. Ensure that duplicate records are not entered into the table C. Improve the quality of data entered for a specific property D. Prevent users from changing the values stored in the table 2020 By Eng. Joud Khattab
  • 246. Question 40 ■ Data integrity constraints are used to: A. Control who is allowed access to the data B. Ensure that duplicate records are not entered into the table C. Improve the quality of data entered for a specific property D. Prevent users from changing the values stored in the table 2020 By Eng. Joud Khattab
  • 247. Question 41 ■ In order to ensure that an instructor’s salary domain allows only values greater than a specified value use: A. Value>=30000.00 B. Not null; C. Check(value >= 29000.00); D. Check(value) 2020 By Eng. Joud Khattab
  • 248. Question 41 ■ In order to ensure that an instructor’s salary domain allows only values greater than a specified value use: A. Value>=30000.00 B. Not null; C. Check(value >= 29000.00); D. Check(value) 2020 By Eng. Joud Khattab
  • 249. Question 42 ■ Which of the following statement is used to remove the privilege from the user Amir? A. Remove update on department from Amir B. Revoke update on employee from Amir C. Delete select on department from Raj D. Grant update on employee from Amir 2020 By Eng. Joud Khattab
  • 250. Question 42 ■ Which of the following statement is used to remove the privilege from the user Amir? A. Remove update on department from Amir B. Revoke update on employee from Amir C. Delete select on department from Raj D. Grant update on employee from Amir 2020 By Eng. Joud Khattab
  • 251. Question 43 ■ Which of the following is another name for a weak entity? A. Child B. Owner C. Dominant D. All of the mentioned 2020 By Eng. Joud Khattab
  • 252. Question 43 ■ Which of the following is another name for a weak entity? A. Child B. Owner C. Dominant D. All of the mentioned 2020 By Eng. Joud Khattab
  • 253. Question 44 ■ In the __________ normal form, a composite attribute is converted to individual attributes. A. First B. Second C. Third D. Fourth 2020 By Eng. Joud Khattab
  • 254. Question 44 ■ In the __________ normal form, a composite attribute is converted to individual attributes. A. First B. Second C. Third D. Fourth 2020 By Eng. Joud Khattab
  • 255. Question 45 ■ The syntax of a user query is verified by: A. Query optimizer B. DBA C. Parser D. None of the above 2020 By Eng. Joud Khattab
  • 256. Question 45 ■ The syntax of a user query is verified by: A. Query optimizer B. DBA C. Parser D. None of the above 2020 By Eng. Joud Khattab
  • 257. Question 46 ■ DBA stands for: A. Data Bank Access. B. Database Access. C. Data Bank Administration. D. Database Administrator. 2020 By Eng. Joud Khattab
  • 258. Question 46 ■ DBA stands for: A. Data Bank Access. B. Database Access. C. Data Bank Administration. D. Database Administrator. 2020 By Eng. Joud Khattab
  • 259. Question 47 ■ E-R model uses which symbol to represent weak entity set : A. Dotted rectangle B. Diamond C. Doubly outlined rectangle. D. None of the above. 2020 By Eng. Joud Khattab
  • 260. Question 47 ■ E-R model uses which symbol to represent weak entity set : A. Dotted rectangle B. Diamond C. Doubly outlined rectangle. D. None of the above. 2020 By Eng. Joud Khattab
  • 261. Question 48 ■ The attributes made up of more than one single attributes are called : A. Derived attribute B. Composite attribute C. Single value attribute D. Multi value attribute 2020 By Eng. Joud Khattab
  • 262. Question 48 ■ The attributes made up of more than one single attributes are called : A. Derived attribute B. Composite attribute C. Single value attribute D. Multi value attribute 2020 By Eng. Joud Khattab
  • 263. Question 49 ■ What is the correct syntax of the declaration which defines the XML version? A. <xml version="A.0" /> B. <?xml version="A.0"?> C. <?xml version="A.0" /> D. None of the above 2020 By Eng. Joud Khattab
  • 264. Question 49 ■ What is the correct syntax of the declaration which defines the XML version? A. <xml version="A.0" /> B. <?xml version="A.0"?> C. <?xml version="A.0" /> D. None of the above 2020 By Eng. Joud Khattab
  • 265. Question 50 ■ Which of the following strings are a correct XML name? A. xmlExtension B. xslNewElement C. XMLElement#123 D. All 2020 By Eng. Joud Khattab
  • 266. Question 50 ■ Which of the following strings are a correct XML name? A. xmlExtension B. xslNewElement C. XMLElement#123 D. All 2020 By Eng. Joud Khattab
  • 267. Question 51 ■ Which clause from the following corresponds to the projection operation of the relational algebra ? A. From B. Select C. Where D. Group by 2020 By Eng. Joud Khattab
  • 268. Question 51 ■ Which clause from the following corresponds to the projection operation of the relational algebra ? A. From B. Select C. Where D. Group by 2020 By Eng. Joud Khattab
  • 269. CONTACT INFO 2020 By Eng. Joud Khattab