Data Modeling Basics

2,976 views

Published on

Data Modeling Basics

Published in: Technology
1 Comment
12 Likes
Statistics
Notes
No Downloads
Views
Total views
2,976
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
19
Comments
1
Likes
12
Embeds 0
No embeds

No notes for slide

Data Modeling Basics

  1. 1. DATA MODELING BASICS
  2. 2. What is a Data? • “Data are values of qualitative or quantitative variables, belonging to a set of items”
  3. 3. What is a set of items? • “Set of items” means “set of objects you are interested in”
  4. 4. What is a variable? • Variables are a measurement or characteristics of an item
  5. 5. Qualitative Vs Quantitative variables?
  6. 6. What is a Data Model? • Data modeling is often the first step in creating a database • A data model is a conceptual representation of the data structures that are required by a database. • The data structures include the data objects, the association between data objects • Data model focuses on what data is required and how it should be organized rather than what operations are performed on the data • Data model is independent of hardware or software constraints
  7. 7. Levels of data modeling: • There three level of data modeling: 1. Conceptual data model 2. Logical data model 3. Physical data model
  8. 8. Conceptual Data Model • A conceptual data model identifies the highestlevel relationships between the different entities.
  9. 9. Logical Data Model • A logical data model describes the data in as much detail as possible, without regard to how they will be physical implemented in the database. • Identify entity and relationships. • All attributes of each entity. • Identify primary and foreign key.
  10. 10. Physical Data Model • Physical data model represents how the model will be built in the database.
  11. 11. Entity • An entity is a Person, place, object, event or concept about which data is to be maintained • When implementing a database an entity would transmit to a table
  12. 12. Attribute • An attribute is a property of an entity which describes the characteristics of a particular entity instance. An attribute can be of three types: a. Unique Identifier: A UID is an attribute whose value uniquely identifies an entity instance. A UID is implemented as a Primary Key. b. Mandatory Attribute: A mandatory attribute is one whose value cannot be null. c. Optional Attribute: An optional attribute is one whose value can be null.
  13. 13. Entity Relationship Models • Cardinality: Cardinality specifies how many instances of an entity relate to one instance of another entity 1. One-to-One Relationships 2. One-to-Many Relationships 3. Many-to-Many Relationships • Ordinality: Ordinality describes the relationship as either mandatory or optional 1. Mandatory Relationships 2. Optional Relationships • Recursive Relationships
  14. 14. Mandatory, Many-to-Many INSTRUCTOR STUDENT
  15. 15. Optional, Many-to-Many DEPARTMENT STUDENT
  16. 16. Optional/Mandatory, Many-to-Many INSTRUCTOR SKILL
  17. 17. Optional/Mandatory, One-to-Many PRODUCT VENDOR
  18. 18. Mandatory, One-to-One AUTOMOBILE ENGINE
  19. 19. Recursive EMPLOYEE is supervised by supervises
  20. 20. Resolving Many-to-Many Relationships • Many-to-many relationships should be avoided. We can resolve a many-to-many relationship by dividing it into two one-to-many relationships.
  21. 21. Resolving Many-to-Many Relationships SALES ORDERS SALES ORDERS INV. ITEMS ORDER ITEMS INV. ITEMS
  22. 22. CUSTOMERS SALES ORDERS ORDER ITEMS INV. ITEMS

×