Muhammad Abbas Database Systems abbas aricsgmail com Recap
Muhammad Abbas Database Systems abbas. arics@gmail. com
Recap Relationship? Types of relationship ERD
Relationship §Relationship is an association among one or more entity types. § 1 -1 § 1 -M §M-M selects Student Subejct
Degree of relationship? § The degree of a relationship is the number of entity types that participate in that relationship. • Unary (1 • Binary (2 • Ternary (3
1 Unary Relationship § A unary relationshipis a relationship between the instances of a single entity type.
2 Most common Binary Relationship § A binary relationship is a relationship between the instances of two entity types.
3 Ternary Relationship § A ternary relationship is a simultaneous relationship amongthe instances of three entity types. .
Database Models §ER Model §Relational Model
ER Model § An entity-relationship model (E-R model) is a detailed, logical representation of the data for an organization.
… § The E-R model was introduced in a key article by Chen (1976) Main constructs of the E-R model ü Entities ü relationships ü their associated attributes Student selects Subejct
ERD E-R Diagram §A graphical representation of an E -R model.
DBS § A customer submits an order requesting some products § The items used in products are supplied by some supplier via shipment • Customer • Order • Product • Supplier • Shipment
ERD
Next Lecture…… - Relational Database
Converting (Mapping) E-R Model to Relational Model E-R Model Relational Model Normalization Database
Relational Model §The relational data model was first introduced in 1970 by E. F. Codd
Relational Model §The relational data model represents data in the form of tables
Popular y? §The relational model is based on mathematical theory
Relational Model The relational data model consists of the following three components § Data structure § Data manipulation (using SQL) § Data integrity
Comparison ER Model Relational Model Database Traditional Programmer Entity Relation Table File Entity Instance Tuple Row Record Attribute Column Field Identifier Key Key (or link)
Relational Model includes: §Relations §Tuples §Attributes §keys
Relational Model Relation §A relation is a named, two-dimensional table of data. PK Tuple Attribute Student SID Name Class GPA 1 Ali MCS 2. 8 2 Ahmad BCS 3. 6 3 Fahad BCS 3. 2
Relational Model Concepts §Cardinality: Number of tuples. §Degree: Number of attributes. SID Name Class GPA 1 Ali MCS 2. 8 2 Ahmad BCS 3. 6 3 Fahad BCS 3. 2 Degree : 3 : 4 Cardinality
Activity §Identify entities , and draw ER diagram §Client purchases book, §Makes payment and §Collects receipt
How to use DBMS………
Thanks Allah Hafiz
- Slides: 27