database model Flashcards
Collection of logical constructs used to represent the data
structure and the data relationships found within the database.
DATABASE MODELS
Focuses on the logical nature of the data representation
Conceptual model
Has an emphasis on how data are represented in the database or on
how data structures are implemented to represent what is modeled.
Implementation model
Collection of records logically organized to conform to the
upside-down tree (hierarchical) structure. The structure allows representing information using parent/child
relationships: each parent can have many children, but each child
has only one parent (also known as a 1-to-many relationship).
Hierarchical Database Model
On the model, the employee data table represents the “parent”
part of the hierarchy, while the computer table represents the
“child” part of the hierarchy.
True
is a database model conceived as a flexible way of representing
objects and their relationships.
Network Database Model
perceived as a collection of tables, tables are related to each other by sharing a common entity characteristic (foreign key),
It uses a structure that allows us to identify and access data in
relation to another piece of data in the database.
Relational Database Model
a person, place, event, or thing for which we intend to collect
data
Entity
characteristics of each entity
Student – student number, name, address, contact number
Attributes
collection of entities that share common characteristics
Entity set
two-dimensional structure composed of rows and columns
Table
Characteristics of a Relational Table:
*Each table row (tuple) represents a single entity within the entity set
*Each column represents an attribute, and each column has a distinct name
*Each row/column intersection represents a single data value
True
An object is described by its factual content.
Object-Oriented Database Model
are abstractions of real-world entities or events.
Objects
is a collection of similar objects with shared structure
(attributes) and behavior (methods); organized in class a hierarchy
class
An object can inherit the attributes and methods of the classes
True
graphically represents data as entities and their relationships in a database structure
Entity Relationship Model
Diagrams created by this process are called
entity-relationship diagrams, ER diagrams, or ERDs.
A relationship expressed with a verb that implies direction,
makes it impossible to discuss the model using correct English.
Relationship Names
It has also become prevalent to name roles with phrases e.g.
is-the-owner-of and is-owned-by etc.
Role naming
Set or group of set used in database
Cardinalities
Set or group of set used in database
This includes:
One to one
One to many
Many to one
Many to many
A single row of first table associates with single row of second table.
One to One
A single row of first table associates with more than one rows of second table.
One to Many
Many rows of first table associate with a single row of second table.
Many to One
Many rows of first table associate with many rows of second
table.
Many to Many
represent entities as boxes, and
relationships as lines between the boxes.
Crow’s Foot diagrams
Different shapes at the ends of these lines represent the
cardinality of the relationship.
Crow’s Foot Notation
Relationships have two indicators, shown on both sides of the line.
True
In crow’s foot notation:
A multiplicity of one and a mandatory relationship is represented
by a straight line perpendicular to the relationship line.
A multiplicity of many is represented by the three-pronged
‘crow-foot’ symbol.
An optional relationship is represented by an empty circle.
True
Enables programmer to view data logically rather than physically
Relational model
has advantages of structural and data independence
Table
consists of one or more attributes that determine other
attributes
Keys
key that is composed of more than one attributes that uniquely
identifies a record on a table
Composite key
an attribute that uniquely identifies each entity in a table
Superkey
Super Key is a superset of Candidate key.
True
student_id is unique for every row of data, hence it can be used to identity each row uniquely.
True
Superkey can have redundancies
True
defined as the minimal set of fields which can
uniquely identify each record in a table.
Candidate key
A candidate key can never be NULL and its value should be
unique.
True
There can be more than one candidate keys for a table.
True
candidate key that uniquely identifies all other attribute values in
any given row.
Primary key
attribute whose values match the primary key values in the
related table.
Foreign key
key that is used for data retrieval purposes.
Secondary key