SlideShare a Scribd company logo
1 of 40
Chapter 14




                       Database Design



McGraw-Hill/Irwin    Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
Objectives
       • Compare and contrast conventional files and modern,
         relational databases.
       • Define and give examples of fields, records, files, and
         databases.
       • Describe modern data architecture of files, operational
         databases, data warehouses, personal databases, and work
         group databases.
       • Compare roles of systems analyst, database administrator,
         and data administrator.
       • Describe architecture of database management system
       • Describe how a relational database implements entities,
         attributes, and relationships from a logical data model.
       • Transform a logical data model into a physical, relational
         database schema.
14-2
       • Generate SQL to create the database structure in a schema.
14-3
Conventional Files
       versus the Database
       File – a collection of similar records.
         • Files are unrelated to each other except in
           the code of an application program.
         • Data storage is built around the applications
           that use the files.

       Database – a collection of interrelated files
         • Records in one file (or table) are physically
           related to records in another file (or table).
         • Applications are built around the integrated
14-4       database
Files versus Database




14-5
Pros and Cons of
       Conventional Files
              Pros                    Cons
       • Easy to design       • Harder to adapt to
         because of their       sharing across
         single-application     applications
         focus                • Harder to adapt to
       • Excellent              new requirements
         performance due      • Need to duplicate
         to optimized           attributes in several
         organization for a     files.
         single application
14-6
Pros and Cons of Databases
               Pros                       Cons
       • Data independence       • More complex than file
         from applications         technology
         increases               • Somewhat slower
         adaptability and          performance
         flexibility             • Investment in DBMS
       • Superior scalability      and database experts
       • Ability to share data   • Need to adhere to
         across applications       design principles to
       • Less, and controlled      realize benefits
         redundancy (total       • Increased vulnerability
         non-redundancy is         due to consolidating in
         not achievable)           a centralized database
14-7
Fields

        Field – the smallest unit of meaningful
        data to be stored in a database
        • the physical implementation of a data
          attribute




14-8
Fields (continued)
       Primary key – a field that uniquely identifies a record.

       Secondary key – a field that identifies a single record
       or a subset of related records.

       Foreign key – a field that points to records in a
       different file.

       Descriptive field – any nonkey field.
14-9
Records

        Record – a collection of fields arranged in a
        predetermined format.
          • Fixed-length record structures
          • Variable-length record structures


        Blocking factor – the number of logical
        records included in a single read or write
        operation (from the computer’s
        perspective).
14-10
Files and Tables

        File – the set of all occurrences of a given
        record structure.

        Table – the relational database equivalent
        of a file.




14-11
Types of conventional files
        and tables
        • Master files – Records relatively permanent
          though values may change
        • Transaction files – Records describe business
          events
        • Document files – Historical data for review
          without overhead of regenerating document
        • Archival files – Master and transaction records
          that have been deleted
        • Table lookup files – Relatively static data that
          can be shared to maintain consistency
        • Audit files – Special records of updates to
14-12     other files
File and Table Design

        • Older file design methods required
          analyst to specify precisely how records
          should be:
          • Sequenced (File organization)
          • Accessed (File access)
        • Database technology usually
          predetermines and/or limits this
          • Trained database administrator may be given
            some control over organization, storage
            location, and access methods for
14-13       performance tuning.
Data Architecture

        Data architecture – a definition of how:
          • Files and databases are to be developed and
            used to store data
          • The file and/or database technology to be
            used
          • The administrative structure set up to
            manage the data resource



14-14
Data Architecture (continued)
        Data is stored in some combination of:
          • Conventional files
          • Operational databases – databases that
            support day-to-day operations and
            transactions for an information system. Also
            called transactional databases.
          • Data warehouses – databases that store
            data extracted from operational databases.
              • To support data mining
          • Personal databases
14-15
          • Work group databases
A Modern Data Architecture




14-16
Administrators

        Data administrator – a database specialist
        responsible for data planning, definition,
        architecture, and management.

        Database administrator – a specialist
        responsible for database technology, database
        design,construction, security, backup and
        recovery, and performance tuning.
          • A database administrator will administer one or more
            databases
14-17
Database Architecture
        Database architecture – the database
        technology used to support data architecture
          • Including the database engine, database utilities,
            CASE tools, and database development tools.

        Database management system (DBMS) –
        special software used to create, access, control,
        and manage a database.
          • The core of the DBMS is its database engine.
          • A data definition language (DDL) is used to physically
            define tables, fields, and structural relationships.
          • A data manipulation language (DML) is used to
            create, read, update, and delete records in database
14-18       and navigate between records.
Typical DBMS Architecture




14-19
Relational Databases

        Relational database – a database that
         implements stored data in a series of two-
         dimensional tables that are “related” to one
         another via foreign keys.
          • The physical data model is called a schema.
          • The DDL and DML for a relational database is called
            SQL (Structured Query Language).
          • Triggers – programs embedded within a database
            that are automatically invoked by updates.
          • Stored procedures – programs embedded within a
            database that can be called from an application
            program.
14-20
From Logical Data Model …




14-21
… To Physical Data Model
        (Relational Schema)




14-22
User Interface for a
        Relational PC DBMS




14-23
What is a Good Data Model?
        • A good data model is simple
          • The data attributes that describe an entity should
            describe only that entity

        • A good data model is essentially nonredundant
          • Each data attribute exists in at most one entity
            (except for foreign keys)

        • A good data model should be flexible and
          adaptable to future needs

          These goals are achieved through database
14-24     normalization.
Database Normalization
        (also see Chapter 8)
        • A logical entity (or physical table) is in first normal form
          if there are no attributes (fields) that can have more than
          one value for a single instance (record).

        • A logical entity (or physical table) is in second normal
          form if it is in first normal form and if the values of all
          nonprimary key attributes are dependent on the full
          primary key.

        • A logical entity (or physical table) is in third normal
          form if it is in second normal form and if the values of all
          nonprimary key attributes are not dependent on other
14-25     nonprimary key attributes.
Conventional File Design
        • Output and input designs typically completed
          first
        • Fundamental entities from data model designed
          as master or transaction records
          • Master files are typically fixed-length records
          • Associative entities from data model are joined into
            transaction records as variable-length records
        • File access and organization selected
          •   Sequential
          •   Indexed
          •   Hashed
14-26     •   ISAM/VSAM
Goals of Database Design
        • A database should provide for efficient storage,
          update, and retrieval of data.

        • A database should be reliable—the stored data
          should have high integrity and promote user
          trust in that data.

        • A database should be adaptable and scalable to
          new and unforeseen requirements and
          applications.

        • A database should support the business
14-27
          requirements of the information system.
Logical data Model in
        Third Normal Form




14-28
Database Schema

        • Database schema – a model or blueprint
          representing the technical
          implementation of the database.
          • Also called a physical data model




14-29
A Method for Database Design
        1. Review the logical data model.
        2. Create a table for each entity.
        3. Create fields for each attribute.
        4. Create index for each primary & secondary key.
        5. Create index for each subsetting criterion.
        6. Designate foreign keys for relationships.
        7. Define data types, sizes, null settings, domains,
           and defaults for each attribute.
        8. Create or combine tables to implement
           supertype/subtype structures.
14-30
        9. Evaluate/specify referential integrity constraints.
Database Integrity
        • Key integrity – Every table should have a
          primary key.
        • Domain integrity – Appropriate controls must
          be designed to ensure that no field takes on an
          inappropriate value
        • Referential integrity – the assurance that a
          foreign key value in one table has a matching
          primary key value in the related table.
          •   No restriction
          •   Delete: cascade
          •   Delete: restrict
14-31     •   Delete: set null
Data Types for Different
        Database Technologies
Logical Data Type        Physical Data Type    Physical Data Type        Physical Data Type
to be stored in field)      MS Access            MS SQL Server                 Oracle
Fixed length character     TEXT               CHAR (size) or           CHAR (size)
data (use for fields with                     character (size)
relatively fixed length
character data)
Variable length character TEXT                VARCHAR (max size)       VARCHAR (max size)
data (use for fields that                     or
require character data but                    character varying (max
for which size varies                         size)
greatly--such as
ADDRESS)
Very long character data MEMO                 TEXT                     LONG VARCHAR or
(use for long descriptions                                             LONG VARCHAR2
and notes--usually no
more than one such field
per record)
14-32
Data Types for Different
        Database Technologies (cont.)
 Logical Data Type        Physical Data Type     Physical Data Type      Physical Data Type
 to be stored in field)                            MS SQL Server               Oracle
 Integer number              MS Access
                          NUMBER               INT (size) or          INTEGER (size) or
                                               integer      or        NUMBER (size)
                                               smallinteger or
                                               tinuinteger
 Decimal number           NUMBER               DECIMAL (size,         DECIMAL (size, decimal
                                               decimal places) or     places) or
                                               NUMERIC (size,         NUMERIC (size, decimal
                                               decimal places)        places) or
                                                                      NUMBER
 Financial Number         CURRENCY             MONEY                  see decimal number
 Date (with time)         DATE/TIME            DATETIME or            DATE
                                               SMALLDATETIME
                                               Depending on
                                               precision needed
 Current time (use to    not supported         TIMESTAMP              not supported
 store the data and time
 from the computer’s
14-33
 system clock)
Data Types for Different
         Database Technologies (cont.)
 Logical Data Type        Physical Data Type    Physical Data Type      Physical Data Type
 to be stored in field)                            MS SQL Server              Oracle
 Yes or No; or True or    YES/NOAccess
                             MS                BIT                   use CHAR(1) and set a yes
 False                                                               or no domain

 Image                    OLE OBJECT           IMAGE                 LONGRAW
 Hyperlink                HYPERLINK            VARBINARY             RAW
 Can designer define      NO                   YES                   YES
 new data types?




14-34
Physical Database Schema




14-35
Database Schema with
        Referential Integrity Constraints




14-36
Database Distribution and
        Replication
        Data distribution analysis establishes
        which business locations need access to
        which logical data entities and attributes.




14-37
Database Distribution and
        Replication (continued)
        • Centralization
           • Entire database on a single server in one physical location
        • Horizontal distribution (also called partitioning)
           • Tables or row assigned to different database servers/locations.
           • Efficient access and security
           • Cannot always be easily recombined for management analysis
        • Vertical distribution (also called partitioning)
           • Specific table columns assigned to specific databases/servers
           • Similar advantages and disadvantages of Horizontal
        • Replication
           •   Data duplicated in multiple locations
           •   DBMS coordinates updates and synchronization
           •   Performance and accessibility advantages
14-38      •   Increases complexity
Database Capacity Planning
        • For each table sum the field sizes. This is the
          record size.
        • For each table, multiply the record size times
          the number of entity instances to be included in
          the table (planning for growth). This is the table
          size.
        • Sum the table sizes. This is the database size.
        • Optionally, add a slack capacity buffer (e.g.
          10percent) to account for unanticipated factors.
          This is the anticipated database capacity.
14-39
SQL DDL Code
 CREATE TABLE [dbo].[ClassCodes] (
         [ClassID] [Integer] Identity(1,1) NOT NULL,
         [DepartmentCodeID] [varchar] (3) NOT NULL ,
         [SectionCodeID] [varchar] (2) NOT NULL ,
         [ClassCodeID] [varchar] (5) NOT NULL ,
         [GroupCodeID] [varchar] (1) NOT NULL ,
         [ClassDescription] [varchar] (50) NOT NULL ,
         [ValidOnLine] bit NULL ,
         [LastUpdated] [smalldatetime] NULL
 ) ON [PRIMARY]
 GO

 Alter Table [dbo].[ClassCodes] Add Constraint pk_classcodes
          Primary Key (ClassID)
 Alter Table [dbo].[ClassCodes] Add Constraint df_classcodes_groupcodeid
          Default 'A' for GroupCodeID
 Alter Table [dbo].[ClassCodes] Add Constraint fk_classcodes_sectioncodes
          Foreign Key (DepartmentCodeID,SectionCodeID)
          References SectionCodes(DepartmentCodeID,SectionCodeID)
 Alter Table [dbo].[ClassCodes] Add Constraint un_classcodes_Dept_Section_Class
14-40     Unique (DepartmentCodeID,SectionCodeID,ClassCodeID)
 GO

More Related Content

What's hot

FDS (Sixth Edition) | C1 | Databases and Database Users
FDS (Sixth Edition) | C1 | Databases and Database UsersFDS (Sixth Edition) | C1 | Databases and Database Users
FDS (Sixth Edition) | C1 | Databases and Database UsersHarsh Verdhan Raj
 
Dfd examples
Dfd examplesDfd examples
Dfd examplesMohit
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLEDrkhanchanaR
 
Physical Database Design & Performance
Physical Database Design & PerformancePhysical Database Design & Performance
Physical Database Design & PerformanceAbdullah Khosa
 
Operating system structures
Operating system structuresOperating system structures
Operating system structuresMohd Arif
 
Tutorial On Database Management System
Tutorial On Database Management SystemTutorial On Database Management System
Tutorial On Database Management Systempsathishcs
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)Imdad Ullah
 
Ch11-Data Storage Design
Ch11-Data Storage DesignCh11-Data Storage Design
Ch11-Data Storage DesignFajar Baskoro
 
Dbms lifecycle. ..Database System Development Lifecycle
Dbms lifecycle. ..Database System  Development LifecycleDbms lifecycle. ..Database System  Development Lifecycle
Dbms lifecycle. ..Database System Development LifecycleNimrakhan89
 

What's hot (20)

Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
rdbms-notes
rdbms-notesrdbms-notes
rdbms-notes
 
FDS (Sixth Edition) | C1 | Databases and Database Users
FDS (Sixth Edition) | C1 | Databases and Database UsersFDS (Sixth Edition) | C1 | Databases and Database Users
FDS (Sixth Edition) | C1 | Databases and Database Users
 
DBMS Bascis
DBMS BascisDBMS Bascis
DBMS Bascis
 
Dfd examples
Dfd examplesDfd examples
Dfd examples
 
Data models
Data modelsData models
Data models
 
7 Deadlocks
7 Deadlocks7 Deadlocks
7 Deadlocks
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
Unit I Database concepts - RDBMS & ORACLE
Unit I  Database concepts - RDBMS & ORACLEUnit I  Database concepts - RDBMS & ORACLE
Unit I Database concepts - RDBMS & ORACLE
 
Database concepts
Database conceptsDatabase concepts
Database concepts
 
Physical Database Design & Performance
Physical Database Design & PerformancePhysical Database Design & Performance
Physical Database Design & Performance
 
Operating system structures
Operating system structuresOperating system structures
Operating system structures
 
DBMS
DBMSDBMS
DBMS
 
Tutorial On Database Management System
Tutorial On Database Management SystemTutorial On Database Management System
Tutorial On Database Management System
 
Elmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 pptElmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 ppt
 
Processes Control Block (Operating System)
Processes Control Block (Operating System)Processes Control Block (Operating System)
Processes Control Block (Operating System)
 
Normalization in DBMS
Normalization in DBMSNormalization in DBMS
Normalization in DBMS
 
Data models
Data modelsData models
Data models
 
Ch11-Data Storage Design
Ch11-Data Storage DesignCh11-Data Storage Design
Ch11-Data Storage Design
 
Dbms lifecycle. ..Database System Development Lifecycle
Dbms lifecycle. ..Database System  Development LifecycleDbms lifecycle. ..Database System  Development Lifecycle
Dbms lifecycle. ..Database System Development Lifecycle
 

Viewers also liked (18)

Column and hadoop
Column and hadoopColumn and hadoop
Column and hadoop
 
Chapter12 designing databases
Chapter12 designing databasesChapter12 designing databases
Chapter12 designing databases
 
Chap07
Chap07Chap07
Chap07
 
Chap15
Chap15Chap15
Chap15
 
Erakartzeko marketing aurkezpena
Erakartzeko marketing aurkezpenaErakartzeko marketing aurkezpena
Erakartzeko marketing aurkezpena
 
Risk taking and emotions
Risk taking and emotionsRisk taking and emotions
Risk taking and emotions
 
Chap04
Chap04Chap04
Chap04
 
Chap05
Chap05Chap05
Chap05
 
Chap06
Chap06Chap06
Chap06
 
Chap17
Chap17Chap17
Chap17
 
Asi Chap005
Asi Chap005Asi Chap005
Asi Chap005
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
Chap02
Chap02Chap02
Chap02
 
Chap01
Chap01Chap01
Chap01
 
Chap09
Chap09Chap09
Chap09
 
Chap03
Chap03Chap03
Chap03
 
Information Systems Analysis and Design
Information Systems Analysis and DesignInformation Systems Analysis and Design
Information Systems Analysis and Design
 
Software requirements specification of Library Management System
Software requirements specification of Library Management SystemSoftware requirements specification of Library Management System
Software requirements specification of Library Management System
 

Similar to Chap14

Similar to Chap14 (20)

Management information system database management
Management information system database managementManagement information system database management
Management information system database management
 
Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01Fundamentals of Database ppt ch01
Fundamentals of Database ppt ch01
 
Relational
RelationalRelational
Relational
 
Chapter 09
Chapter 09Chapter 09
Chapter 09
 
System Analysis And Design
System Analysis And DesignSystem Analysis And Design
System Analysis And Design
 
Case mis ch05
Case mis ch05Case mis ch05
Case mis ch05
 
Lecture-1.ppt
Lecture-1.pptLecture-1.ppt
Lecture-1.ppt
 
Rdbms
RdbmsRdbms
Rdbms
 
CS3270 - DATABASE SYSTEM - Lecture (1)
CS3270 - DATABASE SYSTEM -  Lecture (1)CS3270 - DATABASE SYSTEM -  Lecture (1)
CS3270 - DATABASE SYSTEM - Lecture (1)
 
(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)
 
Database
DatabaseDatabase
Database
 
Database Systems Lec 1.pptx
Database Systems Lec 1.pptxDatabase Systems Lec 1.pptx
Database Systems Lec 1.pptx
 
Chapter 5 data resource management
Chapter 5  data resource managementChapter 5  data resource management
Chapter 5 data resource management
 
Dbms unit 1
Dbms unit 1Dbms unit 1
Dbms unit 1
 
Dbms
DbmsDbms
Dbms
 
Introduction to RDBMS
Introduction to RDBMSIntroduction to RDBMS
Introduction to RDBMS
 
DBMS introduction
DBMS introductionDBMS introduction
DBMS introduction
 
Unit 01 dbms
Unit 01 dbmsUnit 01 dbms
Unit 01 dbms
 
01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
 
DBMS
DBMSDBMS
DBMS
 

Recently uploaded

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Chap14

  • 1. Chapter 14 Database Design McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved.
  • 2. Objectives • Compare and contrast conventional files and modern, relational databases. • Define and give examples of fields, records, files, and databases. • Describe modern data architecture of files, operational databases, data warehouses, personal databases, and work group databases. • Compare roles of systems analyst, database administrator, and data administrator. • Describe architecture of database management system • Describe how a relational database implements entities, attributes, and relationships from a logical data model. • Transform a logical data model into a physical, relational database schema. 14-2 • Generate SQL to create the database structure in a schema.
  • 4. Conventional Files versus the Database File – a collection of similar records. • Files are unrelated to each other except in the code of an application program. • Data storage is built around the applications that use the files. Database – a collection of interrelated files • Records in one file (or table) are physically related to records in another file (or table). • Applications are built around the integrated 14-4 database
  • 6. Pros and Cons of Conventional Files Pros Cons • Easy to design • Harder to adapt to because of their sharing across single-application applications focus • Harder to adapt to • Excellent new requirements performance due • Need to duplicate to optimized attributes in several organization for a files. single application 14-6
  • 7. Pros and Cons of Databases Pros Cons • Data independence • More complex than file from applications technology increases • Somewhat slower adaptability and performance flexibility • Investment in DBMS • Superior scalability and database experts • Ability to share data • Need to adhere to across applications design principles to • Less, and controlled realize benefits redundancy (total • Increased vulnerability non-redundancy is due to consolidating in not achievable) a centralized database 14-7
  • 8. Fields Field – the smallest unit of meaningful data to be stored in a database • the physical implementation of a data attribute 14-8
  • 9. Fields (continued) Primary key – a field that uniquely identifies a record. Secondary key – a field that identifies a single record or a subset of related records. Foreign key – a field that points to records in a different file. Descriptive field – any nonkey field. 14-9
  • 10. Records Record – a collection of fields arranged in a predetermined format. • Fixed-length record structures • Variable-length record structures Blocking factor – the number of logical records included in a single read or write operation (from the computer’s perspective). 14-10
  • 11. Files and Tables File – the set of all occurrences of a given record structure. Table – the relational database equivalent of a file. 14-11
  • 12. Types of conventional files and tables • Master files – Records relatively permanent though values may change • Transaction files – Records describe business events • Document files – Historical data for review without overhead of regenerating document • Archival files – Master and transaction records that have been deleted • Table lookup files – Relatively static data that can be shared to maintain consistency • Audit files – Special records of updates to 14-12 other files
  • 13. File and Table Design • Older file design methods required analyst to specify precisely how records should be: • Sequenced (File organization) • Accessed (File access) • Database technology usually predetermines and/or limits this • Trained database administrator may be given some control over organization, storage location, and access methods for 14-13 performance tuning.
  • 14. Data Architecture Data architecture – a definition of how: • Files and databases are to be developed and used to store data • The file and/or database technology to be used • The administrative structure set up to manage the data resource 14-14
  • 15. Data Architecture (continued) Data is stored in some combination of: • Conventional files • Operational databases – databases that support day-to-day operations and transactions for an information system. Also called transactional databases. • Data warehouses – databases that store data extracted from operational databases. • To support data mining • Personal databases 14-15 • Work group databases
  • 16. A Modern Data Architecture 14-16
  • 17. Administrators Data administrator – a database specialist responsible for data planning, definition, architecture, and management. Database administrator – a specialist responsible for database technology, database design,construction, security, backup and recovery, and performance tuning. • A database administrator will administer one or more databases 14-17
  • 18. Database Architecture Database architecture – the database technology used to support data architecture • Including the database engine, database utilities, CASE tools, and database development tools. Database management system (DBMS) – special software used to create, access, control, and manage a database. • The core of the DBMS is its database engine. • A data definition language (DDL) is used to physically define tables, fields, and structural relationships. • A data manipulation language (DML) is used to create, read, update, and delete records in database 14-18 and navigate between records.
  • 20. Relational Databases Relational database – a database that implements stored data in a series of two- dimensional tables that are “related” to one another via foreign keys. • The physical data model is called a schema. • The DDL and DML for a relational database is called SQL (Structured Query Language). • Triggers – programs embedded within a database that are automatically invoked by updates. • Stored procedures – programs embedded within a database that can be called from an application program. 14-20
  • 21. From Logical Data Model … 14-21
  • 22. … To Physical Data Model (Relational Schema) 14-22
  • 23. User Interface for a Relational PC DBMS 14-23
  • 24. What is a Good Data Model? • A good data model is simple • The data attributes that describe an entity should describe only that entity • A good data model is essentially nonredundant • Each data attribute exists in at most one entity (except for foreign keys) • A good data model should be flexible and adaptable to future needs These goals are achieved through database 14-24 normalization.
  • 25. Database Normalization (also see Chapter 8) • A logical entity (or physical table) is in first normal form if there are no attributes (fields) that can have more than one value for a single instance (record). • A logical entity (or physical table) is in second normal form if it is in first normal form and if the values of all nonprimary key attributes are dependent on the full primary key. • A logical entity (or physical table) is in third normal form if it is in second normal form and if the values of all nonprimary key attributes are not dependent on other 14-25 nonprimary key attributes.
  • 26. Conventional File Design • Output and input designs typically completed first • Fundamental entities from data model designed as master or transaction records • Master files are typically fixed-length records • Associative entities from data model are joined into transaction records as variable-length records • File access and organization selected • Sequential • Indexed • Hashed 14-26 • ISAM/VSAM
  • 27. Goals of Database Design • A database should provide for efficient storage, update, and retrieval of data. • A database should be reliable—the stored data should have high integrity and promote user trust in that data. • A database should be adaptable and scalable to new and unforeseen requirements and applications. • A database should support the business 14-27 requirements of the information system.
  • 28. Logical data Model in Third Normal Form 14-28
  • 29. Database Schema • Database schema – a model or blueprint representing the technical implementation of the database. • Also called a physical data model 14-29
  • 30. A Method for Database Design 1. Review the logical data model. 2. Create a table for each entity. 3. Create fields for each attribute. 4. Create index for each primary & secondary key. 5. Create index for each subsetting criterion. 6. Designate foreign keys for relationships. 7. Define data types, sizes, null settings, domains, and defaults for each attribute. 8. Create or combine tables to implement supertype/subtype structures. 14-30 9. Evaluate/specify referential integrity constraints.
  • 31. Database Integrity • Key integrity – Every table should have a primary key. • Domain integrity – Appropriate controls must be designed to ensure that no field takes on an inappropriate value • Referential integrity – the assurance that a foreign key value in one table has a matching primary key value in the related table. • No restriction • Delete: cascade • Delete: restrict 14-31 • Delete: set null
  • 32. Data Types for Different Database Technologies Logical Data Type Physical Data Type Physical Data Type Physical Data Type to be stored in field) MS Access MS SQL Server Oracle Fixed length character TEXT CHAR (size) or CHAR (size) data (use for fields with character (size) relatively fixed length character data) Variable length character TEXT VARCHAR (max size) VARCHAR (max size) data (use for fields that or require character data but character varying (max for which size varies size) greatly--such as ADDRESS) Very long character data MEMO TEXT LONG VARCHAR or (use for long descriptions LONG VARCHAR2 and notes--usually no more than one such field per record) 14-32
  • 33. Data Types for Different Database Technologies (cont.) Logical Data Type Physical Data Type Physical Data Type Physical Data Type to be stored in field) MS SQL Server Oracle Integer number MS Access NUMBER INT (size) or INTEGER (size) or integer or NUMBER (size) smallinteger or tinuinteger Decimal number NUMBER DECIMAL (size, DECIMAL (size, decimal decimal places) or places) or NUMERIC (size, NUMERIC (size, decimal decimal places) places) or NUMBER Financial Number CURRENCY MONEY see decimal number Date (with time) DATE/TIME DATETIME or DATE SMALLDATETIME Depending on precision needed Current time (use to not supported TIMESTAMP not supported store the data and time from the computer’s 14-33 system clock)
  • 34. Data Types for Different Database Technologies (cont.) Logical Data Type Physical Data Type Physical Data Type Physical Data Type to be stored in field) MS SQL Server Oracle Yes or No; or True or YES/NOAccess MS BIT use CHAR(1) and set a yes False or no domain Image OLE OBJECT IMAGE LONGRAW Hyperlink HYPERLINK VARBINARY RAW Can designer define NO YES YES new data types? 14-34
  • 36. Database Schema with Referential Integrity Constraints 14-36
  • 37. Database Distribution and Replication Data distribution analysis establishes which business locations need access to which logical data entities and attributes. 14-37
  • 38. Database Distribution and Replication (continued) • Centralization • Entire database on a single server in one physical location • Horizontal distribution (also called partitioning) • Tables or row assigned to different database servers/locations. • Efficient access and security • Cannot always be easily recombined for management analysis • Vertical distribution (also called partitioning) • Specific table columns assigned to specific databases/servers • Similar advantages and disadvantages of Horizontal • Replication • Data duplicated in multiple locations • DBMS coordinates updates and synchronization • Performance and accessibility advantages 14-38 • Increases complexity
  • 39. Database Capacity Planning • For each table sum the field sizes. This is the record size. • For each table, multiply the record size times the number of entity instances to be included in the table (planning for growth). This is the table size. • Sum the table sizes. This is the database size. • Optionally, add a slack capacity buffer (e.g. 10percent) to account for unanticipated factors. This is the anticipated database capacity. 14-39
  • 40. SQL DDL Code CREATE TABLE [dbo].[ClassCodes] ( [ClassID] [Integer] Identity(1,1) NOT NULL, [DepartmentCodeID] [varchar] (3) NOT NULL , [SectionCodeID] [varchar] (2) NOT NULL , [ClassCodeID] [varchar] (5) NOT NULL , [GroupCodeID] [varchar] (1) NOT NULL , [ClassDescription] [varchar] (50) NOT NULL , [ValidOnLine] bit NULL , [LastUpdated] [smalldatetime] NULL ) ON [PRIMARY] GO Alter Table [dbo].[ClassCodes] Add Constraint pk_classcodes Primary Key (ClassID) Alter Table [dbo].[ClassCodes] Add Constraint df_classcodes_groupcodeid Default 'A' for GroupCodeID Alter Table [dbo].[ClassCodes] Add Constraint fk_classcodes_sectioncodes Foreign Key (DepartmentCodeID,SectionCodeID) References SectionCodes(DepartmentCodeID,SectionCodeID) Alter Table [dbo].[ClassCodes] Add Constraint un_classcodes_Dept_Section_Class 14-40 Unique (DepartmentCodeID,SectionCodeID,ClassCodeID) GO

Editor's Notes

  1. This repository of slides is intended to support the named chapter. The slide repository should be used as follows: Copy the file to a unique name for your course and unit. Edit the file by deleting those slides you don’t want to cover, editing other slides as appropriate to your course, and adding slides as desired. Print the slides to produce transparency masters or print directly to film or present the slides using a computer image projector. Each slide includes instructor notes. To view those notes in PowerPoint, click-left on the View Menu; then click left on Notes View sub-menu. You may need to scroll down to see the instructor notes. The instructor notes are also available in hardcopy as the Instructor Guide to Accompany Systems Analysis and Design Methods, 6/ed.
  2. Chapter 14 – Database Design No additional notes
  3. Chapter 14 – Database Design Teaching Notes This slide shows the how this chapter's content fits with the building blocks framework used throughout the textbook. The emphasis of this chapter is with the physical design phase, focusing on KNOWLEDGE. It involves system designers and systems analysts.
  4. Chapter 14 – Database Design Teaching Notes The point about data built around applications or vice-versa is illustrated on the next slide.
  5. Chapter 14 – Database Design Teaching Notes When the emphasis is on the program rather than the data, it leads to redundant and conflicting data.
  6. Chapter 14 – Database Design No additional notes
  7. Chapter 14 – Database Design No additional notes
  8. No additional notes.
  9. No additional notes.
  10. Chapter 14 – Database Design No additional notes
  11. Chapter 14 – Database Design No additional notes
  12. No additional notes.
  13. No additional notes.
  14. Chapter 14 – Database Design No additional notes
  15. Chapter 14 – Database Design No additional notes
  16. Chapter 14 – Database Design Teaching Notes It is useful to walk through this diagram.
  17. Chapter 14 – Database Design No additional notes
  18. Chapter 14 – Database Design No additional notes
  19. Chapter 14 – Database Design Teaching Notes Point out everything above the DBMS block is traditionally called front-end while the DMBS and data are called back-end. Explain that metadata is “data about data” that describes the structure of the user data.
  20. Chapter 14 – Database Design No additional notes
  21. Chapter 14 – Database Design No additional notes
  22. Chapter 14 – Database Design Teaching Notes This is the physical relational database schema for the previous slide.
  23. No additional notes.
  24. Chapter 14 – Database Design No additional notes
  25. Chapter 14 – Database Design Teaching Notes This is a review from Chapter 8. Logical entity = Physical table.
  26. No additional notes.
  27. Chapter 14 – Database Design No additional notes
  28. No additional notes.
  29. No additional notes
  30. Chapter 14 – Database Design Teaching Notes Referential integrity is discussed on the next slide.
  31. Chapter 14 – Database Design No additional notes
  32. Teaching Notes Comparing the data types of different databases underscores database-specific data types vs. conceptual data types and broadens students’ understanding of databases If your school uses another database, add a fourth column
  33. Teaching Notes Comparing the data types of different databases underscores database-specific data types vs. conceptual data types and broadens students’ understanding of databases If your school uses another database, add a fourth column
  34. Teaching Notes Comparing the data types of different databases underscores database-specific data types vs. conceptual data types and broadens students’ understanding of databases If your school uses another database, add a fourth column
  35. Chapter 14 – Database Design No additional notes
  36. Chapter 14 – Database Design No additional notes
  37. Chapter 14 – Database Design No additional notes
  38. No additional notes.
  39. No additional notes.
  40. Teaching Notes DDL can often be created by a CASE tool given a physical data model. DDL can also be hand-written.