Click here to load reader
Mar 14, 2020
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 1
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 1
SE352b Software Engineering SE352b Software Engineering Design ToolsDesign Tools
W6: W6: Database TechnologyDatabase Technology
Operational DatabaseOperational Database
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 2
Software ToolsSoftware Tools
Source Procedure A
Source Procedure B
Source Procedure C
Systems Programming Tools
Programming Language Tools
Database System
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 2
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 3
DB Related IssuesDB Related Issues
Data Models
Schemas
Schema Architecture
DBMS Languages
DBMS Component Modules
Architecture of DBMS
Quality of Design in Relational DB
SQL in general context
Query Processing
Interacting with DBs
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 4
Classification of Classification of DBMSsDBMSs
Based on the data model used:
Traditional: Relational, Network, Hierarchical
Emerging: Object-oriented, Object-relational
Based on the number of users support
single-user (typically used with micro-computers)
multi-user (most DBMSs).
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 3
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 5
Classification of Classification of DBMSsDBMSs(Cont(Cont.).)
Based on architecture centralized
consists of a single DBMS managing a single DB
distributed consists of a single DBMS (called distributed DBMS, or DDBMS) that manages several DB that might be located at different computing systems
DBMS
DB
Centralized DBS
DDBMS
DB DB
Distributed DBS
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 6
Classification of Classification of DBMSsDBMSs(Cont(Cont.).)
A multi-database system (MDBS) supports operations on multiple DBSs,
each consists of separate DBMS or DDBMS
MDBMS
DB DB
DBMS DDBMS
Multi-DBS
DB
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 4
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 7
33--Level SchemaLevel Schema
Internal/Local
External
Conceptual
MDBS: 5MDBS: 5--Level SchemaLevel Schema
To support the main characteristics of MDBS, a 5-level schema architecture is required
an extended version of the 3-level schema
1. External schema
2. Federated schema
an integration of multiple export schemas
3. Export schema
a subset of the component schema that is available to the FDBS
4. Component schema
the conceptual schema of a component
5. Local schema
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 8
DBMS
DB
Centralized DBS
MDBMS
DB DB
DBMS DDBMS
DB
MDBS: 5MDBS: 5--Level SchemaLevel Schema
DBDB--Component 1Component 1 DBDB--Component 2Component 2
MDBMS
DB DB
DBMS DDBMS
DB
33--Level SchemaLevel Schema
Internal/Local
External
Conceptual
55--Level SchemaLevel Schema
ExternalExternal External External
Federated
Export
Component1
Local
Federated Federated
Export
Component2
Local
Export
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 5
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 9
ThreeThree--Schema ArchitectureSchema Architecture(Cont.)(Cont.)
DATABASE
End User End User
External LevelExternal Level External Schema
VIEW External Schema
VIEW External Schema
VIEW External Schema
VIEW
Conceptual LevelConceptual Level Conceptual SchemaConceptual Schema
Internal LevelInternal Level Internal SchemaInternal Schema
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 10
Views Views Example…Example…
Section Id
YearSemesterGradeCourse Number
Student TranscriptStudent NameTRANSCRIPT
Database
Data generated on the fly Using subject areas entities Data generated on the fly Using subject areas entities
Brown
Smith
13599FallACS3380
10299SpringBCS3320
9298FallACS1310
8598FallAMATH2410
11299FallBMATH2410
11999FallCCS1310
Database Definition
(MetaMeta--DataData)
DepartmentCreditCourse NumberCourse NameCourse NameCOURSE
InstructorYearYearSemesterSemesterCourse NumberSection IdentifierSection IdentifierSECTION
MajorClassStudent NumberNameNameSTUDENT
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 6
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 11
DB Related IssuesDB Related Issues
Data Models
Schemas
Schema Architecture
DBMS Languages
DBMS Component Modules
Architecture of DBMS
Business Data Types
Quality of Design in Relational DB
SQL in general context
Query Processing
Interacting with DBs
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 12
Business Data TypesBusiness Data Types
Operational Data
Informational Data Database System
Operational Database
Tools
Informational Database
Tools
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 7
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 13
Operational DataOperational Data The data used to run the day-to-day business
Typically stored in a relational database
possibly, in legacy hierarchical or flat file formats as well
Some characteristics Updated often and through online transactions
Non-historical data (not more than three to six months old)
Optimized for transactional processing
Highly normalized in the relational database for efficient update, maintenance, and integrity
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 14
Informational DataInformational Data
Or information is a representation of the data in a way makes analysis much easier
Analysis can be in the form of decision support
executive information systems
report generation
more in-depth statistical analysis
Created from the wealth of existing operational data
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 8
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 15
RelationalRelational Database DesignDatabase Design
∗ Conceptual design ∗ ER Model is used at this stage to capture
the core business/application concepts and rules ∗ which is then translated to a relational schema
• Schema refinement • Normalization: to tune the schema for efficiency
• check relational schema for redundancies and related anomalies
Physical database design tuning • Consider typical workloads and further refine the database design
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 16
Conceptual DesignConceptual Design
• What? • the entitiesentities and relationshipsrelationships in the enterprise
•• informationinformation about these entities and relationships should we store in the database
• the integrity constraintsintegrity constraints that hold
• Represent this information pictorially in ER diagramsER diagrams,
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 9
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 17
Conceptual Design Conceptual Design ER Diagrams ER Diagrams ---- the basicsthe basics
Entities real world “objects”,
e.g. Students, Courses, Routes, Climbers. Entity sets are drawn as rectangles:
Attributes things typically used as column names,
e.g. Name, Age, Height.
Relationships relationships between entities,
e.g. a student enrolls in a course, a climber climbs a route, etc. :
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 18
ER: ExampleER: Example
IDEF1X Notation http://www.idef.com/IDEF1X.html
Account ID
ACCOUNT
Account Type
Own
CLIENT
Client Name
Client ID Client ID
SE352b 3-Mar-06
(c) Hamada Ghenniwa, ECE, UWO 10
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 19
Relational:Relational: DefinitionsDefinitions
Key a set of attributes of a relation whose values are unique within the relation
If there is more than one key, they are called Candidate KeysCandidate Keys
Prime attributePrime attribute one which is a member of any key
Nonprime attribute
one which is not prime
primary key arbitrarily designated candidate keydesignated candidate key
all other candidate keys are Secondary KeysSecondary Keys
Feb 24, 2006 SE352b, ECE,UWO, Hamada Ghenniwa 20
Client IDClient ID Primary Key Not Nullifyable
ER: ER: Identity & Functional DependencyIdentity & Functional Dependency
IDEF1X Notation
Account ID
ACCOUNT
Account Type
CLIENT
Account ID
ACCOUNT
Client Name Account Type
Client ID Own
Client ID (FK)
Own Client ID (FK) Foreign Key