Chapter 12:   Designing Databases Systems Analysis and Design in a Changing World, Fourth Edition 12
Learning Objectives Describe the differences and similarities between relational and object-oriented database management systems Design a relational database schema based on an entity-relationship diagram Design an object database schema based on a class diagram Systems Analysis and Design in a Changing World, 4th Edition
Learning Objectives ( continued ) Design a relational schema to implement a hybrid object-relational database Describe the different architectural models for distributed databases Systems Analysis and Design in a Changing World, 4th Edition
Overview This chapter describes design of relational and OO data models  Developers transform conceptual data models into detailed database models  Entity-relationship diagrams (ERDs) for traditional analysis Class diagrams for object-oriented (OO) analysis Detailed database models are implemented with database management system (DBMS) Systems Analysis and Design in a Changing World, 4th Edition
Databases and Database  Management Systems Databases (DB)  – integrated collections of stored data that are centrally managed and controlled Database management system (DBMS)  – system software that manages and controls access to database Databases described by a  schema  – description of structure, content, and access controls Systems Analysis and Design in a Changing World, 4th Edition
Components of a DB and DBMS  Systems Analysis and Design in a Changing World, 4th Edition
Important DBMS Capabilities Simultaneous access by multiple users and applications Access to data without application programs (via a query language) Organizational data management with uniform access and content controls Systems Analysis and Design in a Changing World, 4th Edition
Database Models Impacted by technology changes since 1960s Model types Hierarchical  Network Relational Object-oriented Most current systems use relational or object-oriented data models Systems Analysis and Design in a Changing World, 4th Edition
Relational Databases Relational database management system (RDBMS)  organizes data into tables or relations Tables  are two dimensional data structures Tuples  –   rows  or records  Fields   –   columns  or attributes Tables have primary key field(s) that can be used to identify unique records Keys  relate tables to each other Systems Analysis and Design in a Changing World, 4th Edition
Partial Display of Relational Database Table  (Figure 12-2) Systems Analysis and Design in a Changing World, 4th Edition
Designing Relational Databases Create table for each entity type Choose or invent primary key for each table Add  foreign keys  to represent one-to-many relationships Create new tables to represent many-to-many relationships Systems Analysis and Design in a Changing World, 4th Edition
Designing Relational Databases ( continued ) Define  referential integrity  constraints Evaluate schema quality and make necessary improvements Choose appropriate data types and value restrictions (if necessary) for each field Systems Analysis and Design in a Changing World, 4th Edition
Relationship Between Data in Two Tables Systems Analysis and Design in a Changing World, 4th Edition
RMO Entity-Relationship Diagram  (Figure 12-5) Systems Analysis and Design in a Changing World, 4th Edition
Representing Relationships Relational databases use foreign keys to represent relationships One-to-many relationship Add primary key field of “one” entity type as foreign key in table that represents “many” entity type Many-to-many relationship Use the primary key field(s) of both entity types  Use (or create) an associative entity table to represent relationship Systems Analysis and Design in a Changing World, 4th Edition
Entity Tables with Primary Keys  (Figure 12-7) Systems Analysis and Design in a Changing World, 4th Edition
Represent One-to-Many Relationships by Adding Foreign Keys (in italics)  (Figure 12-8) Systems Analysis and Design in a Changing World, 4th Edition
Enforcing Referential Integrity Consistent relational database state Every foreign key value also exists as a primary key value DBMS enforces referential integrity automatically after schema designer identifies primary and foreign keys Systems Analysis and Design in a Changing World, 4th Edition
DBMS Referential Integrity Enforcement When rows containing foreign keys are created DBMS ensures that value also exists as a primary key in a related table When row is deleted DBMS ensures no foreign keys in related tables have same value as primary key of deleted row When primary key value is changed DBMS ensures no foreign key values in related tables contain the same value Systems Analysis and Design in a Changing World, 4th Edition
Evaluating Schema Quality High-quality data model has Uniqueness of table rows and primary keys Ease of implementing future data model changes (flexibility and maintainability) Lack of redundant data (database  normalization ) Database design is not objective or quantitatively measured; it is experience and judgment based Systems Analysis and Design in a Changing World, 4th Edition
Database Normalization Normal forms minimize data redundancy First normal form (1NF)  – no repeating fields or groups of fields Functional dependency  – one-to-one relationship between the values of two fields 2NF  – in 1NF and if each non-key element is functionally dependent on entire primary key 3NF  – in 2NF and if no non-key element is functionally dependent on any other non-key element Systems Analysis and Design in a Changing World, 4th Edition
Decomposition of 1NF Table into 2NF Tables Systems Analysis and Design in a Changing World, 4th Edition IssueDate is determined by CatalogID alone, not by both CatalogID and ProductID
Conversion of 2NF Table into 3NF Tables Systems Analysis and Design in a Changing World, 4th Edition ZipCode determines the value for State, and ZipCode is not the key to the table
Object-Oriented Databases Direct extension of OO design and programming paradigm ODBMS  stores data as objects  Direct support for method storage, inheritance, nested objects, object linking, and programmer-defined data types Object Definition Language (ODL) Standard language for describing structure and content of an object database  Systems Analysis and Design in a Changing World, 4th Edition
Designing Object Databases Determine which classes require persistent storage Define  persistent classes Represent relationships among persistent classes Choose appropriate data types and value restrictions (if necessary) for each field Systems Analysis and Design in a Changing World, 4th Edition
Representing Classes Transient classes Objects exist only during lifetime of program or process Examples: view layer window, pop-up menu Persistent classes Objects not destroyed when program or process ceases execution. State must be remembered. Exist independently of program or process Examples: customer information, employee information Systems Analysis and Design in a Changing World, 4th Edition
Representing Relationships Object identifiers Used to identify objects uniquely Physical storage address or reference Relate objects of one class to another ODBMS uses attributes containing object identifiers to find objects that are related to other objects Keyword  relationship  can be used to declare relationships between classes Systems Analysis and Design in a Changing World, 4th Edition
Representing Relationships ( continued ) Advantages include ODBMS assumes responsibility for determining connection among objects ODBMS assumes responsibility for maintaining referential integrity Type of relationships 1:1, 1:M, M:M (one-to-one, one-to-many, many-to-many) Association class used with M:M Systems Analysis and Design in a Changing World, 4th Edition
RMO Domain Model Class Diagram   (Figure 12-15) Systems Analysis and Design in a Changing World, 4th Edition
One-to-One Relationship Represented with Attributes Containing Object Identifiers Systems Analysis and Design in a Changing World, 4th Edition
One-to-Many Relationship Between  Customer and Order Classes Systems Analysis and Design in a Changing World, 4th Edition
One-to-Many Relationship Represented with Attributes Containing Object Identifiers Systems Analysis and Design in a Changing World, 4th Edition
Many-to-Many Relationship between  Employee and Project Classes  (Figure 12-19) Systems Analysis and Design in a Changing World, 4th Edition
Generalization Hierarchy within  the RMO Class Diagram  (Figure 12-21) Systems Analysis and Design in a Changing World, 4th Edition
Hybrid Object-Relational Database Design RDBMS ( hybrid DBMS ) used to store object attributes and relationships Design complete relational schema and simultaneously design equivalent set of classes Mismatches between relational data and OO  Class methods cannot be directly stored or automatically executed Relationships are restricted compared to ODBMS ODBMS can represent wider range of data types Systems Analysis and Design in a Changing World, 4th Edition
Classes and Attributes  Designers store classes and object attributes in RDBMS by table definition Relational schema can be designed based on class diagram Table is created for each class Fields of each table same as attributes of class Row holds attribute values of single object Key field is chosen for each table Systems Analysis and Design in a Changing World, 4th Edition
Views of Stored Data  Systems Analysis and Design in a Changing World, 4th Edition
Relationships Relationships are represented with foreign keys  Foreign key values serve same purpose as object identifiers in ODBMS 1:M relationship  –  add primary key field of class on “one” side of the relationship to table representing class on “many” side  M:M relationship  –  create new table that contains primary key fields of related class tables and attributes of the relationship itself Systems Analysis and Design in a Changing World, 4th Edition
Data Access Classes OO design based on a three-layer architecture Data access classes are implementation bridge between data stored in program objects and data in relational database Methods add, update, find, and delete fields and rows in table or tables that represent the class Methods encapsulate logic needed to copy data values from problem domain class to database and vice versa Systems Analysis and Design in a Changing World, 4th Edition
Interaction Among a Domain Class, a Data Access Class, and the DBMS (Figure 12-25) Systems Analysis and Design in a Changing World, 4th Edition
Data Types Storage format and allowable content of program variable, object state variable, or database field or attribute Primitive data types  –  directly implemented Memory address (pointer), Boolean, integer, and so on Complex data types  –  user-defined Dates, times, audio streams, video images, URLs Systems Analysis and Design in a Changing World, 4th Edition
Relational DBMS Data Types Designer must choose appropriate data type for each field in relational database schema Choice for many fields is straightforward Names and addresses use a set of fixed- or variable-length character arrays Inventory quantities can use integers Item prices can use real numbers Complex data types (DATE, LONG, LONGRAW) Systems Analysis and Design in a Changing World, 4th Edition
Subset of Oracle RDBMS Data Types Systems Analysis and Design in a Changing World, 4th Edition
Object DBMS Data Types Use set of primitive and complex data types comparable to RDBMS data types Schema designer can create new data types and associated constraints Classes are complex user-defined data types that combine traditional concept of data with processes (methods) to manipulate data Flexibility to define new data types is one reason that OO tools are widely used Systems Analysis and Design in a Changing World, 4th Edition
Distributed Databases Rare for all organizational data to be stored in a single database in one location Different information systems in an organization are developed at different times Parts of an organization’s data may be owned and managed by different units System performance is improved when data is near primary applications Systems Analysis and Design in a Changing World, 4th Edition
Single Database Server Architecture  (Figure 12-27) Systems Analysis and Design in a Changing World, 4th Edition
Replicated Database Server Architecture (Figure 12-28) Systems Analysis and Design in a Changing World, 4th Edition
Partitioning Database Schema  into Client Access Subsets Systems Analysis and Design in a Changing World, 4th Edition
Partitioned Database Server Architecture Systems Analysis and Design in a Changing World, 4th Edition
Federated Database  Server Architecture Systems Analysis and Design in a Changing World, 4th Edition
RMO Distributed Database Architecture Starting point for design was information about data needs of geographically dispersed users RMO gathered information during analysis phase RMO decided to manage database using Park City data center mainframe RMO is evaluating single-server vs. replicated and partitioned database server architectures Information on network traffic and costs needed Systems Analysis and Design in a Changing World, 4th Edition
Single-Server Database  Server Architecture for RMO Systems Analysis and Design in a Changing World, 4th Edition
Replicated and Partitioned Database  Server Architecture for RMO Systems Analysis and Design in a Changing World, 4th Edition
Summary Modern information systems store data in database and access and manage data using DBMS Relational DBMS is commonly used Object DBMS is increasing in popularity Key activity of systems design is developing relational or object database schema Relational database is collection of data stored in tables and is developed from entity-relationship diagram Systems Analysis and Design in a Changing World, 4th Edition
Summary ( continued ) Object database stores data as collection of related objects and is developed from class diagram Objects can also be stored in RDBMS RDBMS cannot store methods  RDBMS cannot directly represent inheritance Medium and larger information systems typically use multiple databases or database servers in various geographic locations Systems Analysis and Design in a Changing World, 4th Edition
Systems Analysis and Design in a Changing World, 4th Edition Thank You Nurdin Al-Azies http://www.azies-site.co.cc [email_address]

More Related Content

PPT
11 si(systems analysis and design )
PPT
13 si(systems analysis and design )
PPT
08 si(systems analysis and design )
PPT
06 si(systems analysis and design )
PPT
09 si(systems analysis and design )
PPT
03 si(systems analysis and design )
PPT
01 si(systems analysis and design )
PPT
05 si(systems analysis and design )
11 si(systems analysis and design )
13 si(systems analysis and design )
08 si(systems analysis and design )
06 si(systems analysis and design )
09 si(systems analysis and design )
03 si(systems analysis and design )
01 si(systems analysis and design )
05 si(systems analysis and design )

What's hot (20)

PPT
14 si(systems analysis and design )
PPT
07 si(systems analysis and design )
PPT
02 si(systems analysis and design )
PPT
04 si(systems analysis and design )
PPT
Chapter05
PPT
10 si(systems analysis and design )
PPT
The Traditional Approach to Requirement
PPT
Chapter04
PPT
The Object-Oriented Approach to Requirements
PPT
Modeling System Requirement
PPT
Evaluating Alternatives for Requirements, Envireonment, and Implemetation
PPT
Sadcw 6e chapter4
PPT
Chapter03
PPT
Sadcw 6e chapter7
PPTX
Sadcw 7e chapter06-done
PPTX
Sadcw 7e chapter04_recorded
PPTX
Sadcw 7e chapter03-done(1)
PPTX
Domain class model
PPTX
Sadcw 7e chapter01-done
PPT
Chapter12 designing databases
14 si(systems analysis and design )
07 si(systems analysis and design )
02 si(systems analysis and design )
04 si(systems analysis and design )
Chapter05
10 si(systems analysis and design )
The Traditional Approach to Requirement
Chapter04
The Object-Oriented Approach to Requirements
Modeling System Requirement
Evaluating Alternatives for Requirements, Envireonment, and Implemetation
Sadcw 6e chapter4
Chapter03
Sadcw 6e chapter7
Sadcw 7e chapter06-done
Sadcw 7e chapter04_recorded
Sadcw 7e chapter03-done(1)
Domain class model
Sadcw 7e chapter01-done
Chapter12 designing databases
Ad

Viewers also liked (20)

ODP
How does a Global Navigation Satellite know where it is to tell you where you...
PPT
Spce technologies for disaster in thailand
PDF
Inter-sensor comparison of lake surface temperatures derived from MODIS, AVHR...
PDF
Biosight: Quantitative Methods for Policy Analysis: Stochastic Dynamic Progra...
PDF
Jadwal Piala Dunia 2014
PPTX
Presentation
PPT
DustDection_liuyang_Final.ppt
PPT
IGARSS2011(OkiKazuo110726).ppt
PDF
Stochastic Integer Programming. An Algorithmic Perspective
PPTX
Helen Chedzey_The derivation and application of the MODIS 19-band reflectance...
PPTX
Using Satellite Imagery to Measure Pasture Production
PPTX
VALIDATING SATELLITE LAND SURFACE TEMPERATURE PRODUCTS FOR GOES-R AND JPSS MI...
PPT
100528 satellite obs_china_husar
PPT
15 si(systems analysis and design )
PPTX
presentation
PDF
Boston university; operations research presentation; 2013
PDF
FR3TO5.1.pdf
PDF
Divide&Conquer & Dynamic Programming
PPT
WE1.L10 - USE OF NASA DATA IN THE JOINT CENTER FOR SATELLITE DATA ASSIMILATION
PDF
03. dynamic programming
How does a Global Navigation Satellite know where it is to tell you where you...
Spce technologies for disaster in thailand
Inter-sensor comparison of lake surface temperatures derived from MODIS, AVHR...
Biosight: Quantitative Methods for Policy Analysis: Stochastic Dynamic Progra...
Jadwal Piala Dunia 2014
Presentation
DustDection_liuyang_Final.ppt
IGARSS2011(OkiKazuo110726).ppt
Stochastic Integer Programming. An Algorithmic Perspective
Helen Chedzey_The derivation and application of the MODIS 19-band reflectance...
Using Satellite Imagery to Measure Pasture Production
VALIDATING SATELLITE LAND SURFACE TEMPERATURE PRODUCTS FOR GOES-R AND JPSS MI...
100528 satellite obs_china_husar
15 si(systems analysis and design )
presentation
Boston university; operations research presentation; 2013
FR3TO5.1.pdf
Divide&Conquer & Dynamic Programming
WE1.L10 - USE OF NASA DATA IN THE JOINT CENTER FOR SATELLITE DATA ASSIMILATION
03. dynamic programming
Ad

Similar to 12 si(systems analysis and design ) (20)

PPT
02010 ppt ch02
PPT
Ch10
PPT
D.dsgn + dbms
DOCX
COMPUTERS Database
PPT
Data Models.ppt
PPT
Dbms Lec Uog 02
PPT
Week 4 The Relational Data Model & The Entity Relationship Data Model
PPT
DBMS-Week-2about hardware and software.PPT
PPT
DBMS-Week-2about hardware and software.PPT
PPT
DBMS Lecture 06.ppt
PPT
Database management systems cs403 power point slides lecture 06
DOCX
Mc0077 – advanced database systems
PPT
DBMS - Introduction
PPT
Database Technology Teaching Material For Learn
PPTX
Databases and its representation
PPTX
Database Management System, Lecture-1
PDF
Database Concepts & SQL(1).pdf
PPT
Chapter 2 Database Systems Architectures
02010 ppt ch02
Ch10
D.dsgn + dbms
COMPUTERS Database
Data Models.ppt
Dbms Lec Uog 02
Week 4 The Relational Data Model & The Entity Relationship Data Model
DBMS-Week-2about hardware and software.PPT
DBMS-Week-2about hardware and software.PPT
DBMS Lecture 06.ppt
Database management systems cs403 power point slides lecture 06
Mc0077 – advanced database systems
DBMS - Introduction
Database Technology Teaching Material For Learn
Databases and its representation
Database Management System, Lecture-1
Database Concepts & SQL(1).pdf
Chapter 2 Database Systems Architectures

More from Nurdin Al-Azies (20)

PDF
Visi misi prabowo-hatta
PDF
Buku Studi Islam 3 (Dr. Ahmad Alim, LC. MA.)
PDF
Daftar riwayat hidup Jusuf Kalla
PDF
Daftar riwayat hidup Joko Widodo
PDF
Panduan Tour Taman Safari Indonesia
PDF
Jadwal imsyakiyah Ramadhan 1435 H (Terbaru)
PDF
Brosur dan biaya
PDF
Interpersonal skill and creativity (nurdin al azies)
PDF
Desain grafis ver1 2-pdf
PDF
Biar ngampus tak sekedar status
PDF
Kreatif entreupreneur workshop
PDF
Strategi Penyambutan Mahasiswa Baru UNTUK LDK
PDF
Dakwah Kreatif
PDF
Adobe Flash:
PPT
7 international linkages
PPT
04 ekonomi mikro rancang bangun ekonomi islam
PPT
03 ekonomi mikro permintaan dan penawaran
PPT
02 ekonomi mikro pendahulan tentang ekonomi mikro
PPT
(KULIAH S2 UIKA) 01 ekonomi mikro (DR. H. IRWAN CH, SE,MM )
PDF
Sony (northwind)
Visi misi prabowo-hatta
Buku Studi Islam 3 (Dr. Ahmad Alim, LC. MA.)
Daftar riwayat hidup Jusuf Kalla
Daftar riwayat hidup Joko Widodo
Panduan Tour Taman Safari Indonesia
Jadwal imsyakiyah Ramadhan 1435 H (Terbaru)
Brosur dan biaya
Interpersonal skill and creativity (nurdin al azies)
Desain grafis ver1 2-pdf
Biar ngampus tak sekedar status
Kreatif entreupreneur workshop
Strategi Penyambutan Mahasiswa Baru UNTUK LDK
Dakwah Kreatif
Adobe Flash:
7 international linkages
04 ekonomi mikro rancang bangun ekonomi islam
03 ekonomi mikro permintaan dan penawaran
02 ekonomi mikro pendahulan tentang ekonomi mikro
(KULIAH S2 UIKA) 01 ekonomi mikro (DR. H. IRWAN CH, SE,MM )
Sony (northwind)

Recently uploaded (20)

PDF
Architecture types and enterprise applications.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
DP Operators-handbook-extract for the Mautical Institute
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Benefits of Physical activity for teenagers.pptx
PPTX
The various Industrial Revolutions .pptx
PPTX
observCloud-Native Containerability and monitoring.pptx
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
Hindi spoken digit analysis for native and non-native speakers
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
A novel scalable deep ensemble learning framework for big data classification...
Architecture types and enterprise applications.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf
WOOl fibre morphology and structure.pdf for textiles
Enhancing emotion recognition model for a student engagement use case through...
DP Operators-handbook-extract for the Mautical Institute
Zenith AI: Advanced Artificial Intelligence
Benefits of Physical activity for teenagers.pptx
The various Industrial Revolutions .pptx
observCloud-Native Containerability and monitoring.pptx
Module 1.ppt Iot fundamentals and Architecture
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
Final SEM Unit 1 for mit wpu at pune .pptx
Getting Started with Data Integration: FME Form 101
Hindi spoken digit analysis for native and non-native speakers
Group 1 Presentation -Planning and Decision Making .pptx
sustainability-14-14877-v2.pddhzftheheeeee
Assigned Numbers - 2025 - Bluetooth® Document
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A novel scalable deep ensemble learning framework for big data classification...

12 si(systems analysis and design )

  • 1. Chapter 12: Designing Databases Systems Analysis and Design in a Changing World, Fourth Edition 12
  • 2. Learning Objectives Describe the differences and similarities between relational and object-oriented database management systems Design a relational database schema based on an entity-relationship diagram Design an object database schema based on a class diagram Systems Analysis and Design in a Changing World, 4th Edition
  • 3. Learning Objectives ( continued ) Design a relational schema to implement a hybrid object-relational database Describe the different architectural models for distributed databases Systems Analysis and Design in a Changing World, 4th Edition
  • 4. Overview This chapter describes design of relational and OO data models Developers transform conceptual data models into detailed database models Entity-relationship diagrams (ERDs) for traditional analysis Class diagrams for object-oriented (OO) analysis Detailed database models are implemented with database management system (DBMS) Systems Analysis and Design in a Changing World, 4th Edition
  • 5. Databases and Database Management Systems Databases (DB) – integrated collections of stored data that are centrally managed and controlled Database management system (DBMS) – system software that manages and controls access to database Databases described by a schema – description of structure, content, and access controls Systems Analysis and Design in a Changing World, 4th Edition
  • 6. Components of a DB and DBMS Systems Analysis and Design in a Changing World, 4th Edition
  • 7. Important DBMS Capabilities Simultaneous access by multiple users and applications Access to data without application programs (via a query language) Organizational data management with uniform access and content controls Systems Analysis and Design in a Changing World, 4th Edition
  • 8. Database Models Impacted by technology changes since 1960s Model types Hierarchical Network Relational Object-oriented Most current systems use relational or object-oriented data models Systems Analysis and Design in a Changing World, 4th Edition
  • 9. Relational Databases Relational database management system (RDBMS) organizes data into tables or relations Tables are two dimensional data structures Tuples – rows or records Fields – columns or attributes Tables have primary key field(s) that can be used to identify unique records Keys relate tables to each other Systems Analysis and Design in a Changing World, 4th Edition
  • 10. Partial Display of Relational Database Table (Figure 12-2) Systems Analysis and Design in a Changing World, 4th Edition
  • 11. Designing Relational Databases Create table for each entity type Choose or invent primary key for each table Add foreign keys to represent one-to-many relationships Create new tables to represent many-to-many relationships Systems Analysis and Design in a Changing World, 4th Edition
  • 12. Designing Relational Databases ( continued ) Define referential integrity constraints Evaluate schema quality and make necessary improvements Choose appropriate data types and value restrictions (if necessary) for each field Systems Analysis and Design in a Changing World, 4th Edition
  • 13. Relationship Between Data in Two Tables Systems Analysis and Design in a Changing World, 4th Edition
  • 14. RMO Entity-Relationship Diagram (Figure 12-5) Systems Analysis and Design in a Changing World, 4th Edition
  • 15. Representing Relationships Relational databases use foreign keys to represent relationships One-to-many relationship Add primary key field of “one” entity type as foreign key in table that represents “many” entity type Many-to-many relationship Use the primary key field(s) of both entity types Use (or create) an associative entity table to represent relationship Systems Analysis and Design in a Changing World, 4th Edition
  • 16. Entity Tables with Primary Keys (Figure 12-7) Systems Analysis and Design in a Changing World, 4th Edition
  • 17. Represent One-to-Many Relationships by Adding Foreign Keys (in italics) (Figure 12-8) Systems Analysis and Design in a Changing World, 4th Edition
  • 18. Enforcing Referential Integrity Consistent relational database state Every foreign key value also exists as a primary key value DBMS enforces referential integrity automatically after schema designer identifies primary and foreign keys Systems Analysis and Design in a Changing World, 4th Edition
  • 19. DBMS Referential Integrity Enforcement When rows containing foreign keys are created DBMS ensures that value also exists as a primary key in a related table When row is deleted DBMS ensures no foreign keys in related tables have same value as primary key of deleted row When primary key value is changed DBMS ensures no foreign key values in related tables contain the same value Systems Analysis and Design in a Changing World, 4th Edition
  • 20. Evaluating Schema Quality High-quality data model has Uniqueness of table rows and primary keys Ease of implementing future data model changes (flexibility and maintainability) Lack of redundant data (database normalization ) Database design is not objective or quantitatively measured; it is experience and judgment based Systems Analysis and Design in a Changing World, 4th Edition
  • 21. Database Normalization Normal forms minimize data redundancy First normal form (1NF) – no repeating fields or groups of fields Functional dependency – one-to-one relationship between the values of two fields 2NF – in 1NF and if each non-key element is functionally dependent on entire primary key 3NF – in 2NF and if no non-key element is functionally dependent on any other non-key element Systems Analysis and Design in a Changing World, 4th Edition
  • 22. Decomposition of 1NF Table into 2NF Tables Systems Analysis and Design in a Changing World, 4th Edition IssueDate is determined by CatalogID alone, not by both CatalogID and ProductID
  • 23. Conversion of 2NF Table into 3NF Tables Systems Analysis and Design in a Changing World, 4th Edition ZipCode determines the value for State, and ZipCode is not the key to the table
  • 24. Object-Oriented Databases Direct extension of OO design and programming paradigm ODBMS stores data as objects Direct support for method storage, inheritance, nested objects, object linking, and programmer-defined data types Object Definition Language (ODL) Standard language for describing structure and content of an object database Systems Analysis and Design in a Changing World, 4th Edition
  • 25. Designing Object Databases Determine which classes require persistent storage Define persistent classes Represent relationships among persistent classes Choose appropriate data types and value restrictions (if necessary) for each field Systems Analysis and Design in a Changing World, 4th Edition
  • 26. Representing Classes Transient classes Objects exist only during lifetime of program or process Examples: view layer window, pop-up menu Persistent classes Objects not destroyed when program or process ceases execution. State must be remembered. Exist independently of program or process Examples: customer information, employee information Systems Analysis and Design in a Changing World, 4th Edition
  • 27. Representing Relationships Object identifiers Used to identify objects uniquely Physical storage address or reference Relate objects of one class to another ODBMS uses attributes containing object identifiers to find objects that are related to other objects Keyword relationship can be used to declare relationships between classes Systems Analysis and Design in a Changing World, 4th Edition
  • 28. Representing Relationships ( continued ) Advantages include ODBMS assumes responsibility for determining connection among objects ODBMS assumes responsibility for maintaining referential integrity Type of relationships 1:1, 1:M, M:M (one-to-one, one-to-many, many-to-many) Association class used with M:M Systems Analysis and Design in a Changing World, 4th Edition
  • 29. RMO Domain Model Class Diagram (Figure 12-15) Systems Analysis and Design in a Changing World, 4th Edition
  • 30. One-to-One Relationship Represented with Attributes Containing Object Identifiers Systems Analysis and Design in a Changing World, 4th Edition
  • 31. One-to-Many Relationship Between Customer and Order Classes Systems Analysis and Design in a Changing World, 4th Edition
  • 32. One-to-Many Relationship Represented with Attributes Containing Object Identifiers Systems Analysis and Design in a Changing World, 4th Edition
  • 33. Many-to-Many Relationship between Employee and Project Classes (Figure 12-19) Systems Analysis and Design in a Changing World, 4th Edition
  • 34. Generalization Hierarchy within the RMO Class Diagram (Figure 12-21) Systems Analysis and Design in a Changing World, 4th Edition
  • 35. Hybrid Object-Relational Database Design RDBMS ( hybrid DBMS ) used to store object attributes and relationships Design complete relational schema and simultaneously design equivalent set of classes Mismatches between relational data and OO Class methods cannot be directly stored or automatically executed Relationships are restricted compared to ODBMS ODBMS can represent wider range of data types Systems Analysis and Design in a Changing World, 4th Edition
  • 36. Classes and Attributes Designers store classes and object attributes in RDBMS by table definition Relational schema can be designed based on class diagram Table is created for each class Fields of each table same as attributes of class Row holds attribute values of single object Key field is chosen for each table Systems Analysis and Design in a Changing World, 4th Edition
  • 37. Views of Stored Data Systems Analysis and Design in a Changing World, 4th Edition
  • 38. Relationships Relationships are represented with foreign keys Foreign key values serve same purpose as object identifiers in ODBMS 1:M relationship – add primary key field of class on “one” side of the relationship to table representing class on “many” side M:M relationship – create new table that contains primary key fields of related class tables and attributes of the relationship itself Systems Analysis and Design in a Changing World, 4th Edition
  • 39. Data Access Classes OO design based on a three-layer architecture Data access classes are implementation bridge between data stored in program objects and data in relational database Methods add, update, find, and delete fields and rows in table or tables that represent the class Methods encapsulate logic needed to copy data values from problem domain class to database and vice versa Systems Analysis and Design in a Changing World, 4th Edition
  • 40. Interaction Among a Domain Class, a Data Access Class, and the DBMS (Figure 12-25) Systems Analysis and Design in a Changing World, 4th Edition
  • 41. Data Types Storage format and allowable content of program variable, object state variable, or database field or attribute Primitive data types – directly implemented Memory address (pointer), Boolean, integer, and so on Complex data types – user-defined Dates, times, audio streams, video images, URLs Systems Analysis and Design in a Changing World, 4th Edition
  • 42. Relational DBMS Data Types Designer must choose appropriate data type for each field in relational database schema Choice for many fields is straightforward Names and addresses use a set of fixed- or variable-length character arrays Inventory quantities can use integers Item prices can use real numbers Complex data types (DATE, LONG, LONGRAW) Systems Analysis and Design in a Changing World, 4th Edition
  • 43. Subset of Oracle RDBMS Data Types Systems Analysis and Design in a Changing World, 4th Edition
  • 44. Object DBMS Data Types Use set of primitive and complex data types comparable to RDBMS data types Schema designer can create new data types and associated constraints Classes are complex user-defined data types that combine traditional concept of data with processes (methods) to manipulate data Flexibility to define new data types is one reason that OO tools are widely used Systems Analysis and Design in a Changing World, 4th Edition
  • 45. Distributed Databases Rare for all organizational data to be stored in a single database in one location Different information systems in an organization are developed at different times Parts of an organization’s data may be owned and managed by different units System performance is improved when data is near primary applications Systems Analysis and Design in a Changing World, 4th Edition
  • 46. Single Database Server Architecture (Figure 12-27) Systems Analysis and Design in a Changing World, 4th Edition
  • 47. Replicated Database Server Architecture (Figure 12-28) Systems Analysis and Design in a Changing World, 4th Edition
  • 48. Partitioning Database Schema into Client Access Subsets Systems Analysis and Design in a Changing World, 4th Edition
  • 49. Partitioned Database Server Architecture Systems Analysis and Design in a Changing World, 4th Edition
  • 50. Federated Database Server Architecture Systems Analysis and Design in a Changing World, 4th Edition
  • 51. RMO Distributed Database Architecture Starting point for design was information about data needs of geographically dispersed users RMO gathered information during analysis phase RMO decided to manage database using Park City data center mainframe RMO is evaluating single-server vs. replicated and partitioned database server architectures Information on network traffic and costs needed Systems Analysis and Design in a Changing World, 4th Edition
  • 52. Single-Server Database Server Architecture for RMO Systems Analysis and Design in a Changing World, 4th Edition
  • 53. Replicated and Partitioned Database Server Architecture for RMO Systems Analysis and Design in a Changing World, 4th Edition
  • 54. Summary Modern information systems store data in database and access and manage data using DBMS Relational DBMS is commonly used Object DBMS is increasing in popularity Key activity of systems design is developing relational or object database schema Relational database is collection of data stored in tables and is developed from entity-relationship diagram Systems Analysis and Design in a Changing World, 4th Edition
  • 55. Summary ( continued ) Object database stores data as collection of related objects and is developed from class diagram Objects can also be stored in RDBMS RDBMS cannot store methods RDBMS cannot directly represent inheritance Medium and larger information systems typically use multiple databases or database servers in various geographic locations Systems Analysis and Design in a Changing World, 4th Edition
  • 56. Systems Analysis and Design in a Changing World, 4th Edition Thank You Nurdin Al-Azies http://www.azies-site.co.cc [email_address]