Documentos de Académico
Documentos de Profesional
Documentos de Cultura
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 . . .
Logical design
The aim of logical design is to construct a relational schema that correctly and efficiently represents all of the information described by an Entity-Relationship schema produced during the conceptual design phase. This is not just a simple translation from one model to another for two main reasons: not all the constructs of the Entity-Relationship model can be translated naturally into the relational model; the schema must be restructured in such a way as to make the execution of the projected operations as efficient as possible.
McGraw-Hill 1999
McGraw-Hill 1999
Logical schema
Integrity constraints
Logical schema
Support documentation
McGraw-Hill 1999
McGraw-Hill 1999
MANAGEMENT
(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
Table of operations
Operation Operation 1 Operation 2 Operation 3 Operation 4 Type Frequency I 50 per day I 100 per day I 10 per day B 2 per day
McGraw-Hill 1999
(1,N)
Phone Name
EMPLOYEE
(0,N)
(0,1)
MEMBERSHIP
(1,N)
DEPARTMENT
StartDate
PARTICIPATION
(1,N)
PROJECT
McGraw-Hill 1999
Table of accesses
The cost of an operation evaluated using the table of volumes and the navigation schema can be summed up in the table of accesses.
Type R R R R R
McGraw-Hill 1999
Removing generalizations
Analysis of redundancies
A redundancy in a conceptual schema corresponds to a piece of information that can be derived (that is, obtained by a series of retrieval operations) from other data. An Entity-Relationship schema can contain various forms of redundancy.
McGraw-Hill 1999
INVOICE
Tax GrossAmount
TotalAmount
Price
(1,N) COMPOSITION (1,N)
PURCHASE
PRODUCT
NumberOf Inhabitants
PERSON
(1,1)
RESIDENCE
(1,N)
TOWN
(0,N)
TEACHING
(1,N)
STUDENT
(1,1)
(1,1) ASSIGNMENT
COURSE
LECTURER
McGraw-Hill 1999
McGraw-Hill 1999
McGraw-Hill 1999
Operation 1: add a new person with the person town of residence. s Operation 2: print all the data of a town (including the number of inhabitants).
McGraw-Hill 1999
McGraw-Hill 1999
Operation 2 Concept Town Residence Type Accesses Entity 1 Relationship 5000 Type R R
McGraw-Hill 1999
Removing generalizations
The relational model does not allow the direct representation of generalizations of the E-R model. We need, therefore, to transform these constructs into other constructs that are easier to translate: entities and relationships.
McGraw-Hill 1999
E0
A 11 A 21
R1
E3
E1
E2
(X,Y)
R2
E4
McGraw-Hill 1999
A 11
(0,1)
A 21
(0,1)
A type
E0
R1
E3
(0,Y)
R2
E4
A 01
A 02
R 11 R 12
A 11 A 02 A 01 A 01 A 21
E0
E3
(0,1)
A 02 (X,Y)
R1
(0,1)
E3
R G1
A 11 (1,1)
R G2
(1,1) A 21 (X,Y)
E1
E2
R2
E4
E1
E2
R2
E4
McGraw-Hill 1999
McGraw-Hill 1999
A type
A 01
A 02
A 11
(0,1)
E0
(0,1)
R1
E3
R G2
(1,1) A 21
(X,Y)
E2
R2
E4
McGraw-Hill 1999
McGraw-Hill 1999
EMPLOYEE
Salary Tax
PERSONAL DATA
(1,1)
Level
EMPLOYEE DATA
(1,1)
EMPLOYMENT DATA
Salary Tax
McGraw-Hill 1999
Name
AGENCY
(1,N)
Number Name
TELEPHONE
(1,1)
HOLDER
(1,N)
AGENCY
Addresss Town
McGraw-Hill 1999
PERSON
(0,1)
OWNER
(1,1)
APARTMENT
AptAddress
PERSON
(0,1)
AptAddress
McGraw-Hill 1999
PLAYER
Position
COMPOSITION
(0,1)
TEAM
Town
DateJoined
DateLeft
DateJoined (0,1)
COMPOSITION
Name Name
PRESENT
(0,N)
PLAYER
Position (0,N)
TEAM
Town
PAST COMPOSITION
(0,N)
DateJoined
DateLeft
McGraw-Hill 1999
McGraw-Hill 1999
McGraw-Hill 1999
Name
EMPLOYEE
(0,N)
PARTICIPATION
(0,N)
PROJECT
Budget Code
McGraw-Hill 1999
SUPPLIER
SupplierName
(0,N)
SUPPLY
(1,N)
(1,N)
PRODUCT
Type
DEPARTMENT
Name Telephone
SUPPLIER(SupplierID, SupplierName) PRODUCT(Code, Type) DEPARTMENT(Name, Telephone) SUPPLY(Supplier, Product, Department, Quantity)
McGraw-Hill 1999
Name
PLAYER
(1,1)
CONTRACT
(0,N)
TEAM
Town TeamColours
PLAYER(Surname, DateofBirth, Position) TEAM(Name, Town, TeamColours) CONTRACT(PlayerSurname, PlayerDateOfBirth, Team, Salary)
McGraw-Hill 1999
Name
STUDENT
(1,1)
ENROLMENT
(1,N)
UNIVERSITY
Town Address
McGraw-Hill 1999
Name
HEAD
(1,1)
MANAGEMENT
(1,1)
DEPARTMENT
Telephone Branch
HEAD(Number, Name, Salary, Department, StartDate) DEPARTMENT(Name, Telephone, Branch) or HEAD(Number, Name, Salary) DEPARTMENT(Name, Telephone, Branch, Head, StartDate)
McGraw-Hill 1999
Name
EMPLOYEE
(0,1)
MANAGEMENT
(1,1)
DEPARTMENT
Telephone Branch
EMPLOYEE(Number, Name, Salary) DEPARTMENT(Name, Telephone, Branch, Head, StartDate) If both the entities have optional participation: EMPLOYEE(Number, Name, Salary) DEPARTMENT(Name, Telephone, Branch) MANAGEMENT(Head, Department, StartDate)
McGraw-Hill 1999
R3
E1
(1,N)
(1,1)
R1
(0,N)
E5
R4
E6
(0,1)
R5
(1,N) AR5
R6
A21 A22 (1,1)
E2
R2
A31 A32
(0,N)
E4
E3
(0,N)
McGraw-Hill 1999
McGraw-Hill 1999
Possible translation
(X,N)
R
E2
A E21 AE22 E1
E1( A E11,A E12) E2( A E21,A E22) E3( A E31,A E32) R( A E11, A E21, A E31,A R)
E3
(X,N)
(X,N)
R
(X,N)
A E31 A E32
E2
E1
(1,1)
R
(X,N)
E2
McGraw-Hill 1999
E1
(0,1)
E1( A E11,A E12) E2( A E21,A E22) R( A E11, A E21,A R) Alternatively: * * E1( A E11,A E21, A E21, A R ) E2( A E21,A E22)
R
(X,N)
E2
E1
A E11 A E12
(1,1)
R
(X,N)
AR A E21 AE22
E2
McGraw-Hill 1999
Possible translation E1( A E11,A E12, A E21 ,A R) E2( A E21,A E22) Alternatively: E2( A E21,A E22, A E11 ,A R) E1( A E11,A E12)
A E11 A E12 AR
R
(1,1)
E2
E1
(1,1)
R
(0,1)
E2
A E21 AE22
McGraw-Hill 1999
A E11 A E12 AR
Alternatively: * * E1( A E11,A E12, A E21, A R ) E2( A E21,A E22) Alternatively: E1( A E11,A E12) E2( A E21,A E22) R( A E11 , A E21 ,A R)
R
(0,1)
E2
A E21 AE22
McGraw-Hill 1999
Name
EMPLOYEE
(0,N)
PARTICIPATION
(0,N)
PROJECT
Budget Code
McGraw-Hill 1999
PROJECT
Code Name Budget
PARTICIPATION
Employee Project StartDate
McGraw-Hill 1999
Name
PLAYER
(1,1)
CONTRACT
(0,N)
TEAM
Town TeamColours
McGraw-Hill 1999
TEAM CONTRACT
Name Town TeamColours
McGraw-Hill 1999
E5
A51 A52
R1
A61R3
A62R3
E1
A11 A51 A12
E6
A61 A62 A12
E2
A21 A11 A51 A22
R2
A21 A11 A51 A31 A41 AR21 AR22
E3
A31 A32
E4
A41 A42
McGraw-Hill 1999
EMPLOYER
(0,N)
CLASS
Marks PAST
(0,N) (1,1)
StartDate EndDate
(0,N)
StartDate
(0,N)
CURRENT EMPLOYMENT
(1,1)
COMPOSITION
(1,N)
(0,1)
(0,N)
ATTENDANCE
(0,1) (0,N) (0,1)
TEACHING
(0,1)
PAST
SSN Surname
(1,N)
Phone Age
TRAINEE
ATTENDANCE NoOfPart
CURRENT
Age TownOfBirth
COURSE EDITION
(1,1)
CURRENT TEACHING
INSTRUCTOR
TownOfBirth
(1,N)
TYPE
QUALIFICATION
EMPLOYEE
Position
PROFESSIONAL
(0,1)
(0,N)
Level ProfessionalTitle
Expertise
COURSE
Name Code
FREELANCE
PERMANENT
McGraw-Hill 1999
Operational requirements
operation 1: insert a new trainee including all his or her data (to be carried out approximately 40 times a day); operation 2: assign a trainee to an edition of a course (50 times a day); operation 3: insert a new instructor, including all his or her data and the courses he or she is qualified to teach (twice a day); operation 4: assign a qualified instructor to an edition of a course (15 times a day); operation 5: display all the information on the past editions of a course with title, class timetables and number of trainees (10 times a day); operation 6: display all the courses offered, with information on the instructors who are qualified to teach them (20 times a day); operation 7: for each instructor, find the trainees all the courses he or she is teaching or has taught (5 times a week); operation 8: carry out a statistical analysis of all the trainees with all the information about them, about the editions of courses they have attended and the marks obtained (10 times a month).
McGraw-Hill 1999
Database load
Table of volumes Concept Type Class E CourseEdition E Course E Instructor E Freelance E Permanent E Trainee E Employee E Professional E Employer E PastAttendance R CurrentAttendance R Composition R Type R PastTeaching R CurrentTeaching R Qualification R CurrentEmployment R PastEmployment R
Volume 8000 1000 200 300 250 50 5000 4000 1000 8000 10000 500 8000 1000 900 100 500 4000 10000
Table of operations
Operation Operation 1 Operation 2 Operation 3 Operation 4 Operation 5 Operation 6 Operation 7 Operation 8 Type I I I I I I I B Frequency 40 per day 50 per day 2 per day 15 per day 10 per day 20 per day 5 per day 10 per month
McGraw-Hill 1999
McGraw-Hill 1999
McGraw-Hill 1999
Removing generalizations
For the generalization on instructors: the relevant operations make no difference between the child entities and these entities have no specific attributes; we can therefore delete the child entities and add an attribute Type to the parent entity. For the generalization on trainees: the relevant operations make no difference between the child entities but these entities have specific attributes; we can therefore leave all the entities and add two relationships to link each child with the parent entity: in this way, we will have no attributes with possible null values on the parent entity and the dimension of the relations will be reduced.
McGraw-Hill 1999
McGraw-Hill 1999
McGraw-Hill 1999
EMPLOYER
(0,N)
CLASS
(1,1)
TELEPHONE
(1,1)
StartDate EndDate
(0,N)
CURRENT EMPLOYMENT
(1,1)
HOLDER Code
(1,1)
(1,N)
SSN
(0,N)
Surname
(1,N)
(1,N)
TRAINEE
(0,1) (0,1)
(1,N)
Age
ATTENDANCE
COURSE EDITION
(1,1)
TEACHING
INSTRUCTOR
TownOfBirth
(1,N)
PROFESSIONAL DATA
(1,1)
Type
TYPE
(0,N)
QUALIFICATION
EMPLOYEE
Position Level
PROFESSIONAL
(0,1)
COURSE
Name Code
ProfessionalTitle
Expertise
McGraw-Hill 1999
McGraw-Hill 1999
McGraw-Hill 1999
MANAGEMENT
(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
E1
(0,N)
(0,1)
R4
(0,N)
A31
E3
(0,N)
(1,1)
R5
(0,N)
R1
(1,1) A21 A22 (0,N) (1,1) A41
R3
(1,1)
E2
R2
E4
E1
A 31
E2
A 22 A 41
E3
A 51
E4
A 42
E5
A 52
McGraw-Hill 1999
ACCOUNT
(1,N)
(1,N)
ACCOUNT HOLDER
(1,N)
CLIENT
Address
OPERATION
(1,N)
PERSON
COMPANY
Tax Capital Number
TRANSACTION
Amount Date Type TransactionNumber
McGraw-Hill 1999