DB Lecture 2 PDF

Document Details

SmilingAmericium

Uploaded by SmilingAmericium

The French University in Egypt (UFE)

Dr. Nabil M. Eldakhly

Tags

database database management systems data models computer science

Summary

This lecture introduces the concept of databases, covering topics like entity-relationship models, relational databases and data management systems. It is targeted towards computer science students at undergraduate level at a French university in Egypt.

Full Transcript

Lecture 2 Dr. Nabil M. Eldakhly Faculty of Computers and Information – Department of AI-SAMS & The French University in Egypt (UFE) The Database Environment & Development Process (Cont.) Database Approaches- Data Models -...

Lecture 2 Dr. Nabil M. Eldakhly Faculty of Computers and Information – Department of AI-SAMS & The French University in Egypt (UFE) The Database Environment & Development Process (Cont.) Database Approaches- Data Models - 1. Entity ▪ Data model ̶ Graphical systems are used to capture the nature and relationships among data and are used at different levels of abstraction as a database is conceptualized and designed. ▪ CUSTOMERS and ORDERS are objects about which a business maintains the information. They are referred to as “entities.” ‫ ويتم‬،‫) لتوضيح طبيعة البيانات والعالقات بينها‬Graphical systems( ‫يتم استخدام األنظمة الرسومية‬ ▪ "‫ "العمالء‬،‫ على سبيل المثال‬.‫استخدامها في مستويات مختلفة من التجريد عند تخطيط وتصميم قاعدة البيانات‬ "‫ هذه الكائنات تُعرف باسم "الكيانات‬.‫و"الطلبات" هما كائنان (أو عناصر) تحتفظ الشركة بالمعلومات حولهما‬.)Entities( ̶ An entity is like a noun in that it describes a person, a place, an object, an event, or a concept in the business environment for which information must be recorded and retained. ‫ ويجب‬،‫الكيان يشبه االسم في اللغة؛ فهو يصف شخصاً أو مكاناً أو شيئاً أو حدثاً أو مفهوماً في بيئة العمل‬ ▪.‫تسجيل المعلومات عنه واالحتفاظ بها‬ Database Approaches- Data Models (Cont.)- 1. Entity (Cont.) CUSTOMER and ORDER are entities. o The data you are interested in capturing about the entity (e.g., Customer Name) is called an attribute. o Data are recorded for many customers. o Each customer’s information is referred to as an instance of CUSTOMER Database Approaches- Data Models (Cont.)- 2. Relationships ▪ A well-structured database establishes the relationships between entities that exist in organizational data so that desired information can be retrieved. ▪ Most relationships are one-to-one (1: 1), one-to-many (1: M), or many- to-many (M: N). Database Approaches- Data Models (Cont.)- 2. Relationships (Cont.) Figure 1-3b Figure 1-3a A customer can place (the Places relationship) more than one order with a company. However, each order is usually associated with (the Is Placed By relationship) a particular customer. o Figure 1-3a shows the 1:M relationship of customers who may place one or more orders; the 1:M nature of the relationship is marked by the crow’s foot attached to the rectangle (entity) labeled ORDER. However, the relationship between orders and products is M: N. o In Figure 1-3a, an order may be for one or more products, and a product may be included in more than one order. Database Approaches- Data Models (Cont.)- 3. Relational Database ▪ Relational databases establish the relationships between entities by means of common fields included in a file, called a relation. ̶ The relationship between CUSTOMERS and ORDERS entities depicted in the data models in the right figure is established by including the customer id with the customer’s order. ̶ Every time the customer places an order, the customer identification number is also included in the relation that holds order information. ̶ Relational databases use the identification number to establish the relationship between the customer and the order. Database Approaches- Data Models (Cont.)- 3. Relational Database (Cont.) Database Approaches- Data Models (Cont.)- 4. Database Management Systems ▪ A Database Management System (DBMS) is a software system that enables the use of a database approach. ▪ The primary purpose of a DBMS is to provide a systematic method of creating, updating, storing, and retrieving the data stored in a database. ‫ الهدف األساسي من‬.‫) هو برنامج يُستخدم لتطبيق أسلوب قاعدة البيانات‬DBMS( ‫نظام إدارة قواعد البيانات‬ ▪ ‫نظام إدارة قواعد البيانات هو توفير طريقة منظمة إلنشاء البيانات وتحديثها وتخزينها واسترجاعها من قاعدة‬.‫البيانات‬ ▪ A DBMS also provides facilities for controlling data access, enforcing data integrity, managing concurrency control, and restoring a database. ،)‫ وضمان سالمة البيانات (التأكد من دقتها واتساقها‬،‫ أدوات للتحكم في الوصول إلى البيانات‬DBMS ‫كما يقدم‬ ▪ ‫ واستعادة قاعدة البيانات في‬،)‫وإدارة التحكم في التوازي (منع تعارض العمليات التي تحدث في نفس الوقت‬.‫حال حدوث أي أعطال أو مشاكل‬ Database Environment & Development Process Topics ▪ Definition Of Terms ▪ Limitations Of Conventional File Processing ▪ Advantages Of Databases ▪ Costs And Risks Of Databases ▪ Components Of Database Environment ▪ Database Development Process ▪ The Range Of Database Applications Database Environment & Development Process Database Approaches- Advantages- 1. Program-Data Independence ▪ The separation of data descriptions from the application programs that use the data is called data independence. ▪ With the database approach, data descriptions are stored in a central location called the repository. Database Environment & Development Process Database Approaches- Advantages (Cont.)- 2. Planned Data Redundancy ▪ Good database design attempts to integrate previously separate (and redundant) data files into a single, logical structure..‫يحاول التصميم الجيد لقاعدة البيانات دمج ملفات البيانات المنفصلة سابقا (والمكررة) في بنية منطقية واحدة‬ ▪ ̶ Ideally, each primary fact is recorded in only one place in the database. For example, facts about a product of a company such as its finish, price, and so forth, are recorded together in one place in the PRODUCT table, which contains data about each of the company's products. ▪ The database approach does not eliminate redundancy entirely, but it enables the designer to control the type and amount of redundancy. Database Environment & Development Process Database Approaches- Advantages (Cont.)- 3. Improved Data Consistency ▪ By eliminating or controlling data redundancy, we greatly reduce the opportunities for inconsistency. ̶ For example, if a customer’s address is stored only once, we cannot disagree about the customer’s address. When the customer’s address changes, recording the new address is greatly simplified because the address is stored in a single place. ‫ على‬.‫ نقلل بشكل كبير من الفرص التي تؤدي إلى عدم التناسق‬،‫عند التخلص من تكرار البيانات أو التحكم فيه‬ ▪.‫ فلن يكون هناك مجال لالختالف حول عنوان العميل‬،‫ إذا تم تخزين عنوان العميل مرة واحدة فقط‬،‫سبيل المثال‬.‫ يصبح تحديثه أمراً بسيطاً ألن العنوان موجود في مكان واحد فقط‬،‫وعندما يتغير عنوان العميل‬ ▪ Finally, we avoid the wasted storage space that results from redundant data storage..‫ نتجنب إهدار مساحة التخزين التي قد تنتج عن تخزين البيانات المتكررة‬،‫وباإلضافة إلى ذلك‬ ▪ Database Environment & Development Process Database Approaches- Advantages (Cont.)- 4. Improved Data Sharing ▪ A database is designed as a shared corporate resource. ▪ Authorized internal and external users are granted permission to use the database, and each user (or group of users) is provided one or more user views into the database to facilitate this use. ̶ A user view is a logical description of some portion of the database that is required by a user to perform some task. A user view is often developed by identifying a form or report that the user needs on a regular basis. ‫) هو وصف منطقي لجزء معين من قاعدة البيانات يحتاجه المستخدم ألداء مهمة‬User view( ‫▪ منظور المستخدم‬.‫ يتم تطوير منظور المستخدم عادةً من خالل تحديد نموذج أو تقرير يحتاجه المستخدم بشكل منتظم‬.‫محددة‬ For example, an employee working in human resources will need access to confidential employee data; OR, a customer needs access to the product catalog available on a company's Web site. The views of the human resources employee and the customer are drawn from completely different areas of one unified database. ‫ أو قد‬،‫ موظف في قسم الموارد البشرية يحتاج إلى الوصول إلى بيانات الموظفين السرية‬،‫▪ على سبيل المثال‬ ‫ وجهات النظر لكل من‬.‫يحتاج العميل إلى الوصول إلى كتالوج المنتجات المتاح على موقع الشركة اإللكتروني‬.‫موظف الموارد البشرية والعميل مأخوذة من أجزاء مختلفة تماما من قاعدة بيانات موحدة واحدة‬ Database Environment & Development Process Database Approaches- Advantages (Cont.)- 5. Increased Productivity of Application Development ▪ A major advantage of the database approach is that it greatly reduces the cost and time for developing new business applications. ▪ There are three important reasons that database applications can often be developed much more rapidly than conventional file applications: (Assignment) َّ ُ ‫هناك ثالثة أسباب رئيسية تجعل تطبيقات قواعد البيانات غالبا ما ت‬ ‫طور بشكل أسرع من تطبيقات الملفات‬ ▪.‫التقليدية‬ 1. Assuming that the database and the related data capture and maintenance applications have already been designed and implemented, the application developer can concentrate on the specific functions required for the new application, without having to worry about file design or low-level implementation details. ‫ بافتراض أن قاعدة البيانات وتطبيقات جمع البيانات‬:‫▪ إعادة استخدام قاعدة البيانات والتطبيقات المرتبطة بها‬ ‫ يمكن للمطور التركيز فقط على الوظائف المحددة المطلوبة للتطبيق‬،‫وصيانتها قد تم تصميمها وتنفيذها بالفعل‬.‫ دون الحاجة إلى القلق بشأن تصميم الملفات أو تفاصيل التنفيذ التقنية‬،‫الجديد‬ Database Environment & Development Process Database Approaches- Advantages (Cont.)- 5. Increased Productivity of Application Development (Cont.) 2. The DBMS provides a number of high-level productivity tools, such as forms and report generators, and high-level languages that automate some of the activities of database design and implementation. (In subsequent lectures). ‫ مثل أدوات إنشاء النماذج‬،‫) العديد من األدوات اإلنتاجية عالية المستوى‬DBMS( ‫▪ يوفر نظام إدارة قواعد البيانات‬ ‫ ولغات برمجة عالية المستوى التي تعمل على أتمتة بعض األنشطة المتعلقة بتصميم وتنفيذ قواعد‬،‫والتقارير‬.)‫ (سيتم تناول ذلك في المحاضرات الالحقة‬.‫البيانات‬ 3. Significant improvement in application developer productivity, estimated to be as high as 60 percent (Long, 2005), is currently being realized through the use of Web services, based on the use of standard Internet protocols and a universally accepted data format (XML). Web services and XML are covered in subsequent lectures. ‫ بفضل‬،)Long, 2005( %60 ‫ يُقدر بزيادة تصل إلى‬،‫▪ وقد شهدت إنتاجية مطوري التطبيقات تحسنا كبيرا‬ ‫) التي تعتمد على بروتوكوالت اإلنترنت القياسية وتنسيق بيانات عالمي‬Web services( ‫استخدام خدمات الويب‬.‫ في المحاضرات القادمة‬XML ‫) سيتم تناول خدمات الويب و‬XML ( ‫مقبول وهو‬ Database Environment & Development Process Database Approaches- Advantages (Cont.)- 6. Enforcement of Standards ▪ When the database approach is implemented with full management support, the database administration function should be granted single-point authority and responsibility for establishing and enforcing data standards. ‫ يجب منح وظيفة إدارة قواعد البيانات سلطة ومسؤولية‬،‫عند تطبيق أسلوب قاعدة البيانات بدعم كامل من اإلدارة‬ ▪.‫مركزية لتحديد وتطبيق معايير البيانات‬ ̶ These standards will include naming conventions, data quality standards, and uniform procedures for accessing, updating, and protecting data. ‫ وإجراءات موحدة للوصول إلى البيانات‬،‫ معايير جودة البيانات‬،‫تشمل هذه المعايير قواعد تسمية البيانات‬ ▪.‫وتحديثها وحمايتها‬ ▪ The data repository provides database administrators with a powerful set of tools for developing and enforcing these standards..‫يوفر مستودع البيانات مجموعة قوية من األدوات لمديري قواعد البيانات لتطوير هذه المعايير وفرضها‬ ▪ Database Environment & Development Process Database Approaches- Advantages (Cont.)- 7. Improved Data Quality ▪ The database approach provides a number of tools and processes to improve data quality. ▪ Two of the more important are the following: 1. Database designers can specify integrity constraints that are enforced by the DBMS. A constraint is a rule that cannot be violated by database users. We describe numerous types of constraints (also called “business rules”) in the later lectures. ̶ For example, If a customer places an order, the constraint that ensures that the customer and the order remain associated is called a “relational integrity constraint,” and it prevents an order from being entered without specifying who placed the order. 2. One of the objectives of a data warehouse environment is to clean up (or “scrub”) operational data before they are placed in the data warehouse (Jordan, 1996). Database Environment & Development Process Database Approaches- Advantages (Cont.)- 8. Improved Data Accessibility & Responsiveness ▪ With a relational database, end users without programming experience can often retrieve and display data. ▪ For example, an employee can display information about computer desks at Company with the following query: SELECT * FROM Product_T WHERE ProductDescription = “Computer Desk”; ▪ The language used in this query is called Structured Query Language, or SQL. (You will study this language in detail later). Database Environment & Development Process Database Approaches- Advantages (Cont.)- 9. Reduced Program Maintenance ▪ Stored data must be changed frequently for a variety of reasons: new data item types are added, data formats are changed, and so on. ̶ In a file processing environment, the data descriptions and the logic for accessing data are built into individual application programs (this is the program-data dependence issue described earlier). ‫ يتم تضمين أوصاف البيانات والمنطق الخاص بالوصول إلى البيانات داخل برامج‬،‫في بيئة معالجة الملفات‬ ▪.)‫التطبيقات الفردية (وهذا هو ما يُعرف بمشكلة "اعتمادية البرنامج على البيانات" التي تم شرحها سابقا‬ ̶ In a database environment, data are more independent of the application programs that use them. ‫ مما يعني أنه‬،‫ فإن البيانات تكون أكثر استقاللية عن برامج التطبيقات التي تستخدمها‬،‫أما في بيئة قواعد البيانات‬ ▪.‫يمكن استخدام نفس البيانات عبر تطبيقات مختلفة دون الحاجة إلى تعديل هذه التطبيقات بشكل كبير‬ ▪ As a result, program maintenance can be safely reduced in a modern database environment. Database Environment & Development Process Database Approaches- Advantages (Cont.)- 10. Improved Decision Support ▪ Some databases are designed expressly for decision support applications. ̶ For example, some databases are designed to support customer relationship management, whereas others are designed to support financial analysis or supply chain management. ‫ بينما يتم تصميم قواعد‬،)CRM( ‫ يتم تصميم بعض قواعد البيانات لدعم إدارة عالقات العمالء‬،‫على سبيل المثال‬ ▪.‫بيانات أخرى لدعم التحليل المالي أو إدارة سلسلة التوريد‬

Use Quizgecko on...
Browser
Browser