MySQL Part 2
MySQL Part 2
Data Models
Different types of DBMS are available and their
classification is done based on the underlying data model.
Types of DBMS
Relational Data Model
(most widely used)
Object-oriented data model
Entity-relationship data model
Document model
Hierarchical data model.
Relational Data Model
Data is stored in the form of multiple inter-
related tables.
Attribute
Characteristic or parameters for which data are to
be stored in a relation, is called the attribute or
field or column of a table.
Degree
The number of columns (Fields) of a table.
Cardinality
The number of rows (Tuples) of a table.
Domain
A pool (set) of values from which the actual
values of a column are derived.
Important Properties of a Relation
Properties of Columns/Attributes
Each attribute in a relation has a unique name.
Sequence of attributes in a relation is immaterial.
In relation ATTENDANCE,
Roll Number of same student will appear in another row for a
different date.
Similarly, AttendanceDate is repeated for each roll number.
However combination of these two attributes RollNumber
and AttendanceDate together would have unique value as on a
date for a student, attendance will be marked only once.
Hence {RollNumber, AttendanceDate} will make the
composite primary key.
Foreign Key
A foreign key is used to represent the relationship
between two relations. A foreign key is an
attribute whose value is derived from the
primary key of another relation.
Open Source