Documente Academic
Documente Profesional
Documente Cultură
Database Systems
Concepts, Languages and Architectures
Paolo Atzeni Stefano Ceri Stefano Paraboschi Riccardo Torlone McGraw-Hill 1999
To view these slides on-screen or with a projector use the arrow keys to move to the next or previous slide. The return or enter key will also take you to the next slide. Note you can press the escape key to reveal the menu bar and then use the standard Acrobat controls including the magnifying glass to zoom in on details.
To print these slides on acetates for projection use the escape key to reveal the menu and choose print from the file menu. If the slides are too large for your printer then select shrink to fit in the print dialogue box. Press the return or enter key to continue . . .
Database design
Database design is just one of the many activities in the development of an information system within an organization; it should therefore be presented within the wider context of the information system life cycle.
McGraw-Hill 1999
Design
Implementation
Operation
McGraw-Hill 1999
McGraw-Hill 1999
McGraw-Hill 1999
McGraw-Hill 1999
McGraw-Hill 1999
CONCEPTUAL SCHEMA
Logical design
LOGICAL SCHEMA
Physical design
PHYSICAL SCHEMA
Database structure and related documentation
McGraw-Hill 1999
McGraw-Hill 1999
The products of the various phases of a relational database with the E-R model
Conceptual design
Logical design
Physical design
McGraw-Hill 1999
McGraw-Hill 1999
Cardinality of a
(m,M)
External identifier
Generalization Subset
McGraw-Hill 1999
Entities
These represent classes of objects (facts, things, people, for example) that have properties in common and an autonomous existence. CITY, DEPARTMENT, EMPLOYEE, PURCHASE and SALE are examples of entities in an application for a commercial organization. An occurrence of an entity is an object of the class that the entity represents.
McGraw-Hill 1999
EMPLOYEE DEPARTMENT
CITY SALE
McGraw-Hill 1999
Relationships
They represent logical links between two or more entities. RESIDENCE is an example of a relationship that can exist between the entities CITY and EMPLOYEE; EXAM is an example of a relationship that can exist between the entities STUDENT and COURSE. An occurrence of a relationship is an n-tuple made up of occurrences of entities, one for each of the entities involved.
McGraw-Hill 1999
Student
McGraw-Hill 1999
STUDENT
EXAM
COURSE
WORKPLACE
EMPLOYEE
RESIDENCE
CITY
McGraw-Hill 1999
COLLEAGUE
EMPLOYEE
SUCCESSION
Predecessor
SOVEREIGN Successor
McGraw-Hill 1999
SUPPLIER
SUPPLY
PRODUCT
DEPARTMENT
McGraw-Hill 1999
S1 s1 S2
P1 P2 P3
S3 S4
s2 s3 s4
P4 P5
Supplier
D1 D2 D3 D4 Department
Product
McGraw-Hill 1999
Attributes
These describe the elementary properties of entities or relationships. Surname, Salary and Age are possible attributes of the EMPLOYEE entity, while Date and Mark are possible attributes for the relationship EXAM between STUDENT and COURSE. An attribute associates with each occurrence of an entity (or relationship) a value belonging to a set known as the domain of the attribute. The domain contains the admissible values for the attribute.
McGraw-Hill 1999
STUDENT
EnrolmentDate
EXAM
COURSE
Year
WORKPLACE
EMPLOYEE
BIRTHPLACE
CITY
McGraw-Hill 1999
PERSON
McGraw-Hill 1999
An Entity-Relationship schema
MANAGEMENT
Phone
EMPLOYEE
PARTICIPATION
MEMBERSHIP
DEPARTMENT
Name
COMPOSITION
PROJECT
BRANCH
Address
ReleaseDate
McGraw-Hill 1999
Cardinalities
They are specified for each entity participating in a relationship and describe the maximum and minimum number of relationship occurrences in which an entity occurrence can participate. They state therefore how many times in a relationship between entities an occurrence of one of these entities can be linked to occurrences of the other entities involved.
McGraw-Hill 1999
EMPLOYEE
(1,5)
ASSIGNMENT
(0,50)
TASK
McGraw-Hill 1999
McGraw-Hill 1999
ORDER
(0,1)
SALE
(1,1)
INVOICE
PERSON
(1,1)
RESIDENCE
(0,N)
CITY
TOURIST
(1,N)
RESERVATION
(0,N)
VOYAGE
McGraw-Hill 1999
Cardinalities of attributes
They can be specified for the attributes of entities (or relationships) and describe the minimum and maximum number of values of the attribute associated with each occurrence of an entity or a relationship. In most cases, the cardinality of an attribute is equal to (1,1) and is omitted. The value of a certain attribute can be null or there can exist various values of a certain attribute associated with an entity occurrence.
McGraw-Hill 1999
(0,N)
PERSON
(0,1)
McGraw-Hill 1999
Identifiers
They are specified for each entity of a schema and describe the concepts (attributes and/or entities) of the schema that allow the unambiguous identification of the entity occurrences. In many cases, an identifier is formed by one or more attributes of the entity itself: in this case we talk about an internal identifier (also known as a key). Sometimes, however, the attributes of an entity are not sufficient to identify its occurrences unambiguously and other entities need to be involved in the identification.This is called an external identifier.
McGraw-Hill 1999
Registration
AUTOMOBILE
Model Colour
PERSON
McGraw-Hill 1999
Name
STUDENT
(1,1)
ENROLMENT
(1,N)
UNIVERSITY
City Address
McGraw-Hill 1999
McGraw-Hill 1999
MANAGEMENT
(1,1)
(1,N)
Phone Name
EMPLOYEE
(0,N)
(0,1)
MEMBERSHIP
(1,N)
DEPARTMENT
(1,1)
StartDate
PARTICIPATION COMPOSITION
(1,N)
(1,N)
PROJECT
BRANCH
Address
ReleaseDate
McGraw-Hill 1999
Generalizations
These represent logical links between an entity E, known as parent entity, and one or more entities E1,...,En called child entities, of which E is more general, in the sense that it comprises them as a particular case. In this situation we say that E is a generalization of E1,...,En and that the entities E1,...,En are specializations of the E entity.
McGraw-Hill 1999
TaxCode
PERSON
Address
PROFESSIONAL
MAN
WOMAN
MaternityStatus
LAWYER
ENGINEER
DOCTOR
Specialization
McGraw-Hill 1999
Properties of generalizations
Every occurrence of a child entity is also an occurrence of the parent entity. Every property of the parent entity (attributes, identifiers, relationships and other generalizations) is also a property of a child entity. This property of generalizations is known as inheritance.
McGraw-Hill 1999
Classification of generalizations
A generalization is total if every occurrence of the parent entity is also an occurrence of one of the child entities, otherwise it is partial; A generalization is exclusive if every occurrence of the parent entity is at most an occurrence of one of the child entities, otherwise it is overlapping.
McGraw-Hill 1999
PEOPLE
WOMAN
Maternity Status
MAN
EMPLOYEE
STUDENT
MANAGER
PROGRAMMER
Language
Minimum Cardinality
GENERALIZATION
(1,1) (1,N)
CONSTRUCT
BASIC
ATTRIBUTE
Maximum Cardinality
COMPOSITION
(0,N)
PARENT
(0,N)
CHILD
ENTITY
(0,N)
RELATIONSHIP
PARTICIPATION
(2,N)
(1,N)
COMPOSITE ATTRIBUTE
Maximum Cardinality
Minimum Cardinality
McGraw-Hill 1999
McGraw-Hill 1999
Business rules
Business rules are one of the tools used by information systems analysts to describe the properties of an application. According to a widespread classification a business rule can be: the description of a concept relevant to the application, an integrity constraint on the data of the application, a derivation, or rather a concept that can be obtained, by means of an inference or an arithmetical calculation, by other concepts of the schema.
McGraw-Hill 1999
Documentation techniques
Descriptive business rules can be organized as a data dictionary. This is made up of two tables: the first describes the entities of the schema, the others describes the relationships. Business rules that describe constraints can be expressed in the following form: <concept> must/must not <expression on concepts> Business rules that describe derivations can be expressed in the following form: <concept> is obtained by <operations on concepts>
McGraw-Hill 1999
PROJECT
Name
....
....
Relationship Description MANAGEMENT Associate a manager with a department. MEMBERSHIP Associate an employee with a department. ....
Entities involved Employee (0,1), Department (1,1) Employee (0,1) Department (1,N) ....
Attributes
StartDate ....
....
McGraw-Hill 1999
McGraw-Hill 1999
RESIDENCE Name
PERSON
County State
Surname Firstname
CITY
BIRTHPLACE
MAN
Age Height
Age
WOMAN
SERVICE
MILITARY SERVICE
Age
WORKER
McGraw-Hill 1999
REFEREE
Day Series Number Month Year Date
(1,N) (1,1) (1,N)
REFEREEING Number
(1,1)
Result
DAY
PLACING
(1,1)
MATCH
HOME
(1,N)
(1,1)
VISITING
(1,N) (1,N)
NEUTRAL GROUND
Reason City
POSTPONED
Date
POSITION
(1,N)
TEAM
City Trainer
(1,N)
Name
Points
CONTRACT
(1,1)
PLAYER
BirthPlace
(0,N)
PARTICIPATION
(1,N)
Position
McGraw-Hill 1999