INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical...

8
INTRODUCTION TO DATABASE DESIGN

Transcript of INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical...

Page 1: INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.

INTRODUCTION TO DATABASE DESIGN

Page 2: INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.

Definitions

• Database Models: Conceptual, Logical, Physical

• Conceptual: “big picture” overview of data and relationships

• Logical: what data needs to be represented

• Physical: how data is to be stored using a particular type of DBMS

Page 3: INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.

CONCEPTUAL DATA MODEL

(High Level, Big Picture)• Identify and represent important data

and relationships

• Focus on data (‘what’), not process (‘how’)

• Conduct informal brainstorming sessions with client representatives

• Iterate - revise constantly

Page 4: INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.

CONCEPTUAL DATA MODEL COMPONENTS

• Identify ENTITIES - important things (person, place, thing or event) in system that information is to be maintained ; eg STUDENT, TIMETABLE, SUBJECT, PROGRAM, CLASS, ROOM, …

• Identify ATTRIBUTES - characteristic or piece of information that helps to describe an entity; eg STUDENT: id, name, address, program, learn account; SUBJECT: subject code, name, description, …

Page 5: INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.

CONCEPTUAL DATA MODEL COMPONENTS(ctd)

• Identify CANDIDATE KEY(S) for each entity: group of 1 or more attributes which uniquely identify a single occurrence or instance of an entity ; eg STUDENT: ID, SIN

• Choose a PRIMARY KEY for each entity from candidate keys identified- candidate key that most appropriately uniquely and minimally identifies a particular instance or ocurrence of an entity; eg STUDENT: ID, SUBJECT: SUBJECT CODE

Page 6: INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.

CONCEPTUAL DATA MODEL COMPONENTS(ctd)

• Identify RELATIONSHIPS - logical links between entities; eg a STUDENT is registered in a program and a program may have one or more students registered

• Identify CARDINALITY of each relationship - 1:1, 1:m, m:n and mandatory or optional; eg a STUDENT must be registered in only one program and a program may have zero, one or more than one student registered

Page 7: INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.

CONCEPTUAL DATA MODEL COMPONENTS(ctd)

• Prepare ENTITY-RELATIONSHIP DIAGRAM as Conceptual Data Model

• Present Conceptual Data Model to clients and review and revise as additional information is received

Page 8: INTRODUCTION TO DATABASE DESIGN. Definitions Database Models: Conceptual, Logical, Physical Conceptual: “big picture” overview of data and relationships.

ENTITY RELATIONSHIP DIAGRAM (ERD)

• Single ERD represents conceptual model of all data for system

• Symbols: Rectangle - Entity; Line – Relationship, Diamond – Relationship Label; crowsfeet - Cardinality

• ERD is to be read in any direction