Sei sulla pagina 1di 48

IT - 3701

Database Systems
for MSc (CS)

Lecture 3:
Database Development and Data Modeling

Hareem Aslam
Hareem.aslam@pucit.edu.pk

Punjab University College of Information Technology (PUCIT)


DBMS Languages
 Data Definition Language (DDL)
 Data Manipulation Language (DML)
 High-Level or Non-procedural Languages: These include the
relational language SQL
 May be used in a standalone way or may be embedded in a programming
language
 Low Level or Procedural Languages:
 These must be embedded in a programming language
 Data control Language (DCL)
DBMS Languages
 Data Definition Language (DDL):
 Used by the DBA and database designers to specify the conceptual
schema of a database.
 In many DBMSs, the DDL is also used to define internal and external
schemas (views).
 In some DBMSs, separate storage definition language (SDL) and
view definition language (VDL) are used to define internal and
external schemas.
 SDL is typically realized via DBMS commands provided to the DBA and
database designers
DBMS Languages

 Data Manipulation Language (DML):


 Used to specify database retrievals and updates
 DML commands (data sublanguage) can be embedded in a general-
purpose programming language (host language), such as COBOL,
C, C++, or Java.
 A library of functions can also be provided to access the DBMS from a
programming language
 Alternatively, stand-alone DML commands can be applied directly
(called a query language).
Types of DML

 High Level or Non-procedural Language:


 For example, the SQL relational language
 Are “set”-oriented and specify what data to retrieve rather than how
to retrieve it.
 Also called declarative languages.
 Low Level or Procedural Language:
 Retrieve data one record-at-a-time;
 Constructs such as looping are needed to retrieve multiple records,
along with positioning pointers.
Database Language

 DCL (Data Control Language):


It allows the user to define different users of the database and
their privileges.
What is Model?

 A model is a simplified way to describe or explain a complex


reality
Scientific models

Image sources:
http://www.redorbit.com/education/reference_library/space_1/universe/2574692/geocentric_model/
http://hendrianusthe.wordpress.com/2012/06/21/heliocentric-vs-geocentric/
What is data model?
 A set of concepts to describe the structure of a database,
the operations for manipulating these structures, and
certain constraints that the database should obey.
 Structure:
 Typically include elements (and their data types) as well as groups of elements
(e.g. entity, record, table), and relationships among such groups
 Constraints:
 Constraints specify some restrictions on valid data; these constraints must be enforced at
all times
What is data model?

 Operations:
 These operations are used for specifying database retrievals and
updates by referring to the structure of the data model.
 basic model operations (e.g. generic insert, delete, update)
 user-defined operations (e.g. compute_student_gpa,
update_inventory)
Importance of data model

Communication tool

Give an overall view of the database

Organize data for various users

Are an abstraction for the creation of well-designed good


database
Categories of Data Models
 Conceptual (high-level, semantic) data models:
 Provide concepts that are close to the way many users perceive data.
 (Also called entity-based or object-based data models.)

 Physical (low-level, internal) data models:


 Provide concepts that describe details of how data is stored in the
computer. These are usually specified in an ad-hoc manner through DBMS
design and administration manuals
 Implementation (representational) data models:
 Provide concepts that fall between the above two, used by many
commercial DBMS implementations (e.g. relational data models used in
many commercial systems).
Database Models
 Conceptual models include
 Entity-relationship database model (ERDBD)
 Object-oriented model (OODBM)

 Implementation models include


 Hierarchical database model (HDBM)
 Network database model (NDBM)
 Relational database model (RDBM)
 Object-oriented database model (ODBM)
Database Models
(con’t.)
 Relationships in Conceptual Models
 One-to-one (1:1)
 One-to-many (1:M)
 Many-to-many (M:N)

 Implementation Database Models


 Hierarchical
 Network
 Relational
 Object-Oriented
THE EVOLUTION OF DATA
MODELS
Evolution of Database
Modals 1990s
2000s
1980s
1970s
1960s

Object oriented ?
Hierarchical
Relational
Client Oriented

Traditional files Object-relational

Network
History of Database Model
 Hierarchical database model (HDBM)
 Network database model (NDBM)
 Relational database model (RDBM)
 Object-oriented database model (ODBM)
Hierarchical database model (HDBM)
Hierarchical Database Model
(HDBM)
 Logically represented by an upside down tree
 Each parent can have many children (segment linkage)

 Each child has only one parent


 A single table acts as the "root" of the database from which
other tables "branch" out.
 Relationships in such a system are children and parents.
 Parents and children are tied together by links called
"pointers
Hierarchical Database
Model
Logically represented by an upside down tree
 1:M relationship
Hierarchical Database
Model
Hierarchical path (beginning from left)

 Left-list hierarchical path, or preorder traversal, or hierarchical


sequence

Final assembly->Component A-
>Assembly A-> Part A ->Part B ->
Component B -> Component C –
Assembly B -> Part C ->Part D
 Re-list sequence, if the segment is frequently accessed
 Bank systems commonly use HD model
Hierarchical Database
Model
 Bank systems commonly use the HDBM
 customer account can be subject to many transactions
(1:M relationship)
 Relationship is fixed (debiting and crediting)

 Frequently access large amount of transactions


Hierarchical Database
Model
 Advantages
 Conceptual simplicity: relationship between layers is logically simple;
design process is simple
 Database security: enforced uniformly through the system
 Data integrity
 Data independence
 Efficiency in 1:M relationships and when uses require large numbers of
transactions
 Dominant in 1970s , when we used mainframe system with large
databases
Hierarchical Database
Model
 Disadvantages
 Complex implementation: physical data storage characteristics;
database design is complicated
 Difficult to manage and lack of standards
 Lacks structural independence
 Applications programming and use complexity (pointer based)
 Implementation limitations, i.e. especially it only handle 1:M
type of model
Network Database Model (NDBM)
Network Database Model
(NDBM)
 Each record can have multiple parents
 Called by Database Task Group (DBTG) to define standards
 Three crucial database components
 Network schema: conceptual organization of the entire database
 Subschema: portion of database as information for application
programs
 Database management language: defining data characteristics and
data structure
 Schema Data definition language (DDL): define schema components
 Subschema Data definition language
 Data manipulating language: manipulate data content
Network Database
Model
Each record can have multiple parents
 Introduce set to describe relationship
 Each set has owner record and member record, parallel to parent and child
in HDM
 Member may have several owners
 One-ownership
 Hierarchical model is a subset of the network model.
 The network model uses set theory to provide a tree-like hierarchy.
Network Database
Model
 Member may have several owners
Network Database
Model
Advantages

 Conceptual simplicity, just lime HDM
 Handles more relationship types (but all 1:M relationship)
 Data access flexibility
 Promotes database integrity
 Data independence
 Conformance to standards
Network Database
Model
 Disadvantages
 System complexity
(Develop by the Computer programmers for the Computer
Programmers rather than user)
 Lack of structural independence
Relational Database Model
(RDBM)
 Let’s user or database designer to operate human logical
environment
 Perceived by user as a collection of tables for data
storage, while let RDBMS handles the physical details.
 Tables are a series of row/column intersections
 Tables related by sharing common entity characteristics
 It allows 1:1, 1:M, M:N relationships
Relational Database
Model
Relational Database
Model
 Advantages
 Structural independence: data access path is irrelevant to
database design; change structure will not affect the database
 Improved conceptual simplicity
 Easier database design, implementation, management, and use

 Ad hoc query capability with SQL (4GL is added)


 Powerful database management system
Relational Database
Model
 Disadvantages
 Substantial hardware and system software overhead
 Poor design and implementation is made easy
 May promote “islands of information” problems
Systems Development Life Cycle
Project Identification & Selection
Project Initiation & Planning
Analysis
Logical Design

Physical Design

Implementation
Maintenance
Database SDLC
SDLC Database Development
Activities
Identify Project
Enterprise
Initiate and Plan Modeling
Conceptual
Analyze Data Modeling
Logical
Logical Design DB Design
Physical DB
Physical Design Design/Creation
DB
Implementation Implementation
DB
Maintenance Maintenance
Enterprise Data Modeling
The first step in
database
development, in
which the scope and
general contents of
organizational
databases are
specified.
Enterprise Data Model
 A model which includes:
 overall range of organizational databases
 general contents of organizational databases
Conceptual Database Modeling
 Determine user requirements
 Determine business rules Enterprise
 A business rule is a brief, precise, and Modeling
Conceptual
unambiguous description of a policy, Data Modeling
procedure, or principle within a specific Logical
DB Design
organization. Physical DB
Design/Creation
 Build conceptual data model DB
Implementation
 outcome is an entity-relationship diagram
DB
 population of repository Maintenance
Logical Database Design

 Select logical database model Enterprise


Modeling
 commit to a database alternative Conceptual
Data Modeling
 Map Entity-Relationship Diagrams Logical
DB Design
 Normalize data structures Physical DB
Design/Creation
 Specify business rules DB
Implementation
DB
Maintenance
Physical Database
Design
 Select DBMS
Enterprise
 Select storage devices Modeling
 Determine access methods Conceptual
Data Modeling
 Design files and indexes Logical
DB Design
 Determine database distribution Physical DB
Design/Creation
 Specify update strategies DB
Implementation
DB
Maintenance
Database implementation

 Code and test database processing


programs Enterprise
Modeling
 Complete documentation Conceptual
Data Modeling
 Install database and convert data Logical
DB Design
Physical DB
Design/Creation
DB
Implementation
DB
Maintenance
Database Maintenance

 Analyze database and applications to ensure


evolving information requirements are being Enterprise
Modeling
met Conceptual
Data Modeling
 Tune database for improved performance Logical
 Fix errors DB Design
Physical DB
 Provide data recovery when needed Design/Creation
DB
Implementation
DB
Maintenance
Documentation
 most formal development methodologies are
documentation based
 helps managers monitor progress and quality
of project
 facilitates communication between team
members
 includes models
 various stages are not complete until
documentation is accepted
Some Keys to Success...
 accurate requirements definition
 commitment

 effective change management

 manageable size
Textbook
Carlos Coronel, Steve Morris, “Database Systems” Design, Implementation,
Management, 12th Ed. Course Technology, 2016”.

Reference book
 Jeffrey Hoffer, “Modern Database Management ” Design, Implementation, Management,
10th Edition”
 Thomas Connolly, “Database Systems: A Practical Approach to Design, Implementation
and Management (6th Ed.)”
 Elmasri, “Fundamentals of Database Systems: (7th Ed.)”

Potrebbero piacerti anche