Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
•End-user data, that is, raw facts of interest to the end user.
•Metadata, or data about data, through which the end-user data are
integrated and manage.
The metadata provide a description of the data characteristic
and the set of relationships that link the data found within the
database. In a sense, a database resembles a very well-
organized electronic filing cabinet in which powerful software,
known as a database management system, helps manage the
cabinet’s contents.
A database management system (DBMS) is a collection of
programs that manages the database structure and controls
access to the data stored in the database.
The DBMS manages the interaction between the end user and the
database.
End-user Application Database structure
request
Data Metadata
Customers
DBMS
End-user
End-user
Invoices
data
Application
request
Products
Data
Having a DBMS between the end-user’s applications
and the database offers some important advantages.
WORKGROUP ENTERPRISE
MS Access X X X X
MS SQL Server X* X X X X X X
IBM DB2 X* X X X X X X
Oracle X* X X X X X X
RDMS
• An awareness of the problems that plagued file systems can help you
avoid those same pitfalls with DBMS software.
TERM DEFINITION
DATA “Raw” facts, such as a telephone number, a birth date, a customer name,
and a year-to-date (YTD) sales value. Data have little meaning unless they
have been organized in some logical manner.
FIELD A character or group of characters (alphabetic or numeric) that has a
specific meaning. A field is used to define and store data.
RECORD A logically connected set of one or more fields that describes a person,
place, or thing.
FILE A collection of related records.
As the file system grew, the demand for
the DP specialist’s programming skills
grew even faster, and the DP specialist
was authorized to hire additional
programmers. The size of the file system
also required a larger, more complex
computer. The new computer and the
additional programming staff caused the
DP specialist to spend less time
programming and more time managing
technical and human resources.
Therefore, the DP specialist’s job evolved
into that of data processing (DP)
manager, who supervised a DP
department. In spite of these organizational
changes, however, the DP department’s
primary activity remained programming, and
the DP manager inevitably spent much time
as a supervising senior programmer and
program trouble shooter.
It requires extensive programming.
Accounting Dept.
Personnel Dept. Sales Dept. Accounting Dept.
• The employee’s salary must have values that are between 6,000
and 350,000.
• A student’s GPA must be between 1.00 to 3.00.
• Each class must have one and only one teacher.
How do you properly identify entities, attributes,
relationships and constraints?
The first step is to clearly identify
the business rules of the environment
you are modeling.
From a database point of view, the collection of data becomes
meaningful only when it reflects properly defined business rules.
A business rule is a brief, precise, and
unambiguous description of a policy,
procedure, or principle within a specific
organization.
A customer may Note that these business rules establish
generate many entities, relationships, and constraints. For
example, the first two business rules establish
invoices. two entities, CUSTOMER and INVOICE, and
An invoice is 1:M relationship between those entities. The
generated by only one third business rule establishes a constraint:
customer no fewer than 10 people and no more than 30
A training session people; two entities, EMPLOYEE and
cannot be scheduled for TRAINING; and a relationship between
EMPLOYEE and TRAINING.
fewer than 10
employees or for more
than 30 employees.
1.Student may subscribe email account. 1:M
2.Student can enrol in any course. 1:1
3.Student learns programming language. M:N
4.Student attends seminar. M:N
5.File may have filename. 1:
The main sources of business rules are company managers, policy makers,
department managers, and written documentation such as a company’s procedures,
standards, or operation manuals. A faster and more direct source of business rules
is direct interviews with end users.
The process of identifying and documenting business rules is essential to database design for
several reasons:
1
• They help standardize the company’s view of data.
2
• They can be a communications tool between users and designers.
3
• They allow the designer to understand the nature, role, and scope of the data.
4
• They allow the designer to understand business processes.
• They allow the designer to develop appropriate relationship participation rules and constraints and to
5 create an accurate data model.
As a general rule, a noun in a business rule will translate into an entity
in the model and a verb (active or passive) associating nouns will translate
into a relationship among entities.
ENTITY
“A many ”
RELATIONSHIP
GENERATION TIME MODEL EXAMPLES COMMENTS
SECOND 1970s
Hierarchical and IMS ADABAS Early database systems
network IDS-II Navigational access
Conceptual simplicity
THIRD Mid 1970 to present Relational
DB2 Oracle MS
Entity relationship (ER) modeling support for relational data
SQL-Server modeling
Support complex data
Object-oriented Versant VFS/FastObjects
Extended relational products support objects and data
FOURTH Mid 1980 to present Objectivity/DB DB/2 UDB
warehousing
Extended Relational Oracle 10g
Web databases become common
Level 1 Segments
(Root Children) Component A Component B Component C
Level 2 Segments
(Level 2 Children) Assembly A Assembly B Assembly C
Level 3 Segments
(Level 2 Children) Part A Part B Part C Part D Part E
The hierarchical model was developed in the 1960’s to manage large
amounts of data complex manufacturing projects such as the Apollo
rocket that landed on the moon in 1969. Its basic logical structure is
represented by an upside-down “tree”.
The hierarchical data model yielded many advantages over the file system model. In fact,
many of the hierarchical data model’s features formed the foundation for current data
models.
1:M 1:M
INV_LINE
The network model was created to represent complex data relationships
more effectively than the hierarchical model, to improve database
performance, and to impose a database standard. The lack of database
standards was troublesome to programmers and application designers
because it made database designs and applications less portable. Worse,
the lack of even a standard set of database concepts impeded the search
for better data models. Disorganization seldom fosters progress.
To help establish database standards, the Conference on Data Systems Languages
(CODASYL) created the Database Task Group (DBTG) in the late 1960’s. The DBTG was
charged to define standard specifications for an environment that would facilitate database
creation and data manipulation.
The final DBTG report contained specifications for three crucial database components:
Network Schema
The conceptual organization of the entire database as viewed by the database administrator. The schema
includes a definition of the database name, the record type for each record, and the components that make up
those records.
Network Subschema
Defines the portion of the database “seen” by the application programs that actually produce the desired
information from the data contained within the database.
A relational diagram
The relational model was introduced by Egdar F. Codd (of IBM) in
his landmark paper “A Relational Model of Data for Large Shared
Databanks”. The relational model represented a major breakthrough for
both users and designers.
The relational data model is implemented through a very sophisticated relational database
management system (RDBMS). The RDBMS performs the basic functions provided by
the hierarchical and network DBMS systems, in addition to host of other functions that
make the relational data model easier to understand and implement.
Arguably the most important advantage of RDBMS is its ability to hide the complexities of
the relational model from the user. The RDBMS manages all of the physical details, while
the user sees the relational database as a collection of tables in which data are stored and
can manipulate and query data in a way that seems intuitive and logical.
Each table is a matrix consisting of a series of row/column intersections. Tables, also called
relations, are related to each other through sharing of a common entity characteristics
(value in a column). For example, the CUSTOMER table in previous figure might contain
sale agent’s number that is also contained in the AGENT table.
Although the tables are independent of one another, you can easily associate the data
between tables. The relational model provides a minimum level of controlled redundancy to
eliminate most of the redundancies commonly found in file systems.
The relationship type (1:1, 1:M, or M:N) is often shows in relational schema, an
example of which is depicted in figure below. A relational diagram is a
representation of the relational database’s entities, the attributes within those
entities, and the relationships between those entities.
entities
relationships
attributes
Another reason for the relational data model’s rise to dominance is its powerful and flexible
query language. For most relational database software, the query language is Structured
Query Language (SQL). SQL is a 4GL that allows the user to specify what must be done
without specifying how it must be done. The RDBMS uses SQL to translate user queries
into instructions for retrieving data. SQL makes it possible to retrieve data with far less effort
than any other database or file environment.
The end-user
interface.
A collection
of tables
SQL engine.
stored in the
database.
Peter Chen first introduced the ER data model in 1976; it was the
graphical representation of entities and their relationships in a database
structure that quickly became popular because it complemented the relational
data model concepts. The relational model and ERM combined to provide the
foundation for tightly structured database design. ER models are normally
represented in an entity relationship diagram (ERD), which uses graphical
representations to model database components.
The ER model is based on the following components:
1. Entity
2. Relationships
The basic Chen ERD: