COMP2004 - DB Conceptual modelling Flashcards
Entity Relationship Diagram
Specify entities in a system along with their relationships
Conceptual modelling
- model objects
- identify;
Relationships btwn them
Their cardinality and participation
Identify strong and weak entities
Modelling
- objects - from nouns in UML
- attributes - properties of objects
- associations - relationships btwn objects
- cardinality - 1 to many, many to many
- participation - optional, mandatory
Weak entities
Can only exist in the presence of a strong entity ( composite notation)
so on UPDATE/DELETE CASCADE
Composite notation
It is only called composite if the objects it refers to are really its parts, i.e. have no independent existence. For details, see the aggregation section below.
High level model - Conceptual model
Understanding at a high level the different concepts in the system
Middle level model - Logical model
Adding details to the data - middle step between the two
Low level model - physical model
how it is implemented in the database
Functional dependency
Constraint btwn two sets of attributes in a relation from a database
Relation
Is a set of tuples where each element is a member of a data domain. Each distinct domain used in the definition of a relation is called an attribute
Relation
Attribute
| | | | |
—————————–
Tuple | | | | |
—————————–
| | | | |
—————————–
The whole thing is relation
Deriving tables
Objects become tables with the primary key chosen appropriately
Tuple/ Row
A sequence or ordered list of finite length
Column/Attribute
Defines properties of an individual
Relation
Table
Tuple
Row
Attribute
Column
Domain/Type
Attribute type
Defines how a given item is constrained
Schema
Defines a structure of a database
Name ({ as })
Degree of relationship is the number of attributes in a table
Known as relation intension
Model
Structure
Operations
Constraints
Eg relational, semistructure (xml)
Relational model
Model
Schema
State
Super keys
Set of attributes which uniquely identify all other attributes
Values for the attributes in a superkey will identify one unique record
Candidate key
A subset of the super keys which contain the minimal number of attributes to uniquely identify a record
Primary key
One of the candidate keys which the user has specified will be the unique identifier for a record. Irreducible. Not null
PRIMARY KEY FIELDS ARE IN CAPITAL LETTERS