DATA MODELS ppsx

39 227 0
DATA MODELS ppsx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

1B.1 Relational Database Desi g n L L E E S S S S O O N N : : 1 1 B B D D A A T T A A M M O O D D E E L L S S O O b b j j e e c c t t i i v v e e s s In this lesson, you will learn to:  Describe the types of data models  Create an entity-relationship model  List the types of relationships between entities  Define a Relational Database Management System (RDBMS)  Describe the operators that work on relations 1B.2 Relational Database Desi g n Data Models Lesson 2 / Slide 1 of 14©NIIT Data Models Objectives In this section, you will learn to: • Describe the types of data models • Create an entity-relationship model • List the types of relationships between entities • Define a Relational Database Management System (RDBMS) • Describe the operators that work on relations I I N N S S T T R R U U C C T T O O R R N N O O T T E E S S Lesson Overview The lesson identifies the types of data models. This lesson also explains the entity- relationship model and the relational model. In addition, this lesson covers the operators that work on relations. 1B.3 Relational Database Desi g n Data Models©NIIT Data Models Pre-assessment Questions 1. The scope of the database is determined at which stage of the DDLC? 2. Which DBMS user performs only basic operations on the database? 3. Mary Peterson is designing a database system for IMC Inc. She has performed the activities involved in the first four stages of the DDLC. What activity does she need to perform at the implementation stage? 4. Who performs the task of concurrency control in a DBMS? 5. The three-level architecture of a DBMS helps achieve ______. Lesson 2 / Slide 2 of 14 1B.4 Relational Database Desi g n Data Models©NIIT Data Models Solutions Ans1. Requirements definition Ans2. End user Ans3. Select a DBMS, purchase it, and populate the database with data. Ans4. Database manager Ans5. Data independence Lesson 2 / Slide 3 of 14 1B.5 Relational Database Desi g n D D A A T T A A M M O O D D E E L L S S Data Models Lesson 2 / Slide 4 of 14©NIIT Data Models Data Models • A data model is a description of the organization of data in a database. • The data model also describes the relationship among data and any constraints that have to be defined on the data. • Data models can broadly be classified into two categories: • Object-based logical model – focuses on describing the data, the relationship among the data, and any constraints defined. • Record-based logical model – focuses on describing the data structure and the access techniques in a Database Management System. A data model is a description of the organization of data in a database. In addition to the organization of data, the data model also describes the relationship among data and any constraints that have to be defined on the data. Data models can broadly be classified into two categories: Object-based logical model – focuses on describing the data, the relationship among the data, and any constraints defined. Record-based logical model – focuses on describing the data structure and the access techniques in a Database Management System. Object-Based Logical Model There are various object-based models. The most widely used is the entity- relationship model (E/R model). It is accepted as the ideal data model for database 1B.6 Relational Database Desi g n design. Peter Chen introduced this model in 1976, and since then, several people have added value to it. The Entity-Relationship Model Data Models Lesson 2 / Slide 5 of 14©NIIT Data Models Entity-Relationship Model • There are various object-based models. The most widely used is the entity-relationship model (E/R model). • The entity-relationship model is based on a real-world perception that comprises a collection of objects or entities and the relationships among these. • The diagram used to represent an E/R model is called an E/R diagram. • The components of an E/R diagram are: • Entities • Relationships • Attributes The entity-relationship model is based on a real-world perception that comprises a collection of objects or entities and the relationships among these. Chen introduced not only the E/R model, but also a corresponding diagramming technique. Consider the following diagram: 1B.7 Relational Database Desi g n Sample E/R Diagram This diagram has various components and depicts the relationship between the components. The various components of the diagram are entities – course and semester, relationship – taught, and attributes – title, code, start-dt, end-dt, and sem #. 1B.8 Relational Database Desi g n Entities Data Models Lesson 2 / Slide 6 of 14©NIIT Data Models Entities • An entity is any object, place, person, or activity about which data is recorded. • Entities are named and represented inside a box. • There are two types of entities: • Dependent • Independent • Dependent entities are also called weak entities, and independent entities are called regular entities. • Weak entities are represented by double-lined boxes. Chen defined an entity as “a thing, which can be easily identified”. An entity is any object, place, person, or activity about which data is recorded. Some examples of entities are Student, Course, and Grade. In the diagramming technique, entities are named and represented inside a box. Entities It is important to distinguish between an entity type and an entity instance. An entity type is a set of things that share common properties. For example, STUDENT, 1B.9 Relational Database Desi g n COURSE, and GRADE. An entity type is usually in uppercase. An entity instance is a specific individual thing. For example, Jack Ripper is the entity instance of the entity STUDENT, Philosophy is the entity instance of the entity COURSE, and A is the entity instance of the entity GRADE. There are two types of entities: dependent and independent. An entity whose existence depends on the existence of another entity is called a dependent entity. Consider the entity type OFFERING. OFFERING entity refers to the various combinations of subjects offered in a course. A course with the same code can be offered in different semesters on different campuses. The existence of OFFERING depends on the existence of the entity type COURSE. Entity B is existence-dependent on entity A when: Some instance of A must exist before B can exist. Entity A ceases to exist, which causes B to cease to exist. For example, the university offers a COURSE in database design in the second semester. The university can offer this course only if the entity instance “database design” already exists. If the university decides to drop the entity instance “database design” from the curriculum, the offering of the course must also cease to exist. A dependent entity is depicted by a double-lined box and is connected by a line to the entity it depends on. An independent entity does not depend on any other entity for existence. Dependent entities are also called weak entities, and independent entities are called regular entities. Dependent Entity A regular entity and its weak entities can be considered as a single object in a database. This is because weak entities are dependent on the regular entity. 1B.10 Relational Database Desi g n Relationships Data Models Lesson 2 / Slide 7 of 14©NIIT Data Models Relationships • A relationship is an association among entities. • A relationship is depicted as a diamond with the name of the relationship type. • A relationship can associate an entity with itself. • Multiple relationships can also exist between the same entities. • There are three types of relationships: • One-to-One • One-to-Many • Many-to-Many Chen defined a relationship as “an association among entities”. For example, there is a relationship between students and instructors. This relationship represents the fact that an instructor teaches several students and a student is taught by several instructors. This relationship could be named TEACH. As with entities, it is necessary to distinguish between relationship types and instances. A relationship type is an association of entity types. For example, the association between a STUDENT and an INSTRUCTOR where STUDENT and INSTRUCTOR are both entity types. A relationship instance is an association of entity instances, for example, the association between a student called J. Reins and the instructor called Dr. Jack. A relationship is depicted as a diamond with the name of the relationship type. [...]... NELSON 35 III Instructor Table A Relational Database Management System (RDBMS) can be defined as a database management system where all data visible to the user is organized strictly as tables of data values, and where all database operations work on these tables Let’s take a look at the data structure of an RDBMS Relational Data Structure Data Models Relational Data Structure • • • • • • • ©NIIT A table... Model Data Models Relational Model • • • ©NIIT The three types of record-based models are: • Hierarchical model • Network model • Relational model The relational model is an attempt to simplify the database structure It represents all data in the database as simple tables in the row-column format A Relational Database Management System (RDBMS) can be defined as a database management system where all data. .. is organized strictly as tables of data values, and where all database operations work on these tables Data Models Lesson 2 / Slide 9 of 14 Dr E F Codd first described the relational model in 1970 The relational model is an attempt to simplify the database structure It represents all data in the database as simple tables in the row-column format 1B.17 Relational Database Design I_CODE NAME AGE SEMESTER... object-based logical model, we will look at other data models The three types of record-based models are: Hierarchical model Network model Relational model In a hierarchical model, data is represented in the form of a tree Data in a hierarchical model is represented by a collection of records, and relationships between the data are represented by links Relational Database Design 1B.16 A network model is similar... (columns) draw their actual values In an RDBMS, missing or unknown information is represented as a NULL value in a table Data Models Relational Database Design Lesson 2 / Slide 10 of 14 1B.18 Data Models Relational Data Structure (Contd ) • • • ©NIIT Relationships are represented by common data values stored in two or more tables A column in one table whose value matches the primary key in some other table... with one, none, or many occurrences of another entity 1B.13 Relational Database Design Attributes Data Models Attributes • • • ©NIIT An attribute is a property of a given entity Attributes are depicted as ellipses, labeled with the name of the property The key properties are underlined A relationship can also have attributes Data Models Lesson 2 / Slide 8 of 14 An attribute is a property of a given... key Together, a primary key and a foreign key create a parent-child relationship between the tables that connect them Data Models Lesson 2 / Slide 11 of 14 The organizing principle in a relational database is the table, a rectangular row-column arrangement of data values Each table in a database has a unique table name that identifies its contents A table is called a relation The row (or record) in the... be assigned and used instead in some cases 1B.25 Relational Database Design RELATIONAL ALGEBRA Data Models Relational Algebra • • ©NIIT Relational algebra is a collection of operators that operate on relations The operators used in relational algebra are: • Restrict • Project • Product • Union • Intersect • Difference • Join • Divide Data Models Lesson 2 / Slide 12 of 14 The relational model is based... entity instance: Relational Database Design 1B.22 1 Ken Burton 2 Employee 3 Department 4 Research and Development division 5 Supplier Solutions: 1 Entity instance 2 Entity type 3 Entity type 4 Entity instance 5 Entity type You can give the following additional information while explaining hierarchical and network models: In a Hierarchical Database Management System (HDBMS), the data is stored conceptually... hierarchical model in the way that data and the relationships among them are represented in the form of records and links However, records in a database are represented graphically In the relational model, the database is structured in fixed-format records of several types Each record type has a fixed number of attributes or fields, which are usually of fixed length Of these three models, the relational model . manager Ans5. Data independence Lesson 2 / Slide 3 of 14 1B.5 Relational Database Desi g n D D A A T T A A M M O O D D E E L L S S Data Models Lesson 2 / Slide 4 of 14©NIIT Data Models Data Models • A data. 14 1B.4 Relational Database Desi g n Data Models NIIT Data Models Solutions Ans1. Requirements definition Ans2. End user Ans3. Select a DBMS, purchase it, and populate the database with data. Ans4. Database. relations 1B.2 Relational Database Desi g n Data Models Lesson 2 / Slide 1 of 14©NIIT Data Models Objectives In this section, you will learn to: • Describe the types of data models • Create an entity-relationship

Ngày đăng: 01/08/2014, 09:22

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan