You are on page 1of 10

COURSE: DATABASE MANAGEMENT ASSIGNMENT 1

INDEX NUMBER: PS/CSC/21/0061

1. To uniquely identify rows or records in a database table, a database management


system uses both a super key and a candidate key. Yet there is a distinction
between the two:
• The super key A super key is a collection of one or more qualities (columns) that
allow each row in a table to be uniquely identified. To put it another way, a super
key is a collection of characteristics that may be

used to set one row apart from every other row in a table. A super key may contain
characteristics that aren't necessarily required for a row's unique identification. For
instance, a super key in a student table may be a combination of the student's name,
email address, and student ID.
• Candidate key: A candidate key is the bare minimum collection of characteristics
that let each row in a table to be identified exclusively. In other words, a super key
with the feature that no subset of the key can also uniquely identify a row is
referred to as a candidate key. A candidate key must have the quality that no two
rows in the table can share. It is a subset of a super key.
the exact same set of attribute values are used for that key. A potential key in a
student database, for instance, may be the student ID column since no other group
of columns can adequately uniquely identify each row in the table.
In conclusion, a candidate key is a minimal collection of characteristics that can
uniquely identify a row in a database whereas a super key is any set of attributes
that can uniquely identify a row in a table without the need of a valid subset of the
key.
2. In a database management system, a column's or group of columns' values must
be unique, and this is enforced by using both primary keys and unique keys. Yet
the two are different in several ways.
COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

• The main key: An individual row in a table is uniquely identified by a column or


collection of columns known as the primary key. A primary key, then, is a
particular kind of unique key that acts as the principal identifier of a row. A main
key needs to be distinct, non-null, and stable.
There can only be one primary key for each table. A clustered index on the primary
key column(s), which is often created by default in database management systems,
can enhance the performance of queries that use the main key.
• Unique key: In a table, a unique key is a column or group of columns with a
different value for each row. Alternatively put, a unique key guarantees that no two
rows in the database contain the identical values for the designated column (s). A
unique key, unlike a primary key, is not always a row's principal identifier.

Several unique keys may be included in a table, and each unique key may contain
null values (unless it is also specified as a not-null constraint). By using the unique
key column(s) in a foreign key connection, a unique key can be utilized to enforce
referential integrity restrictions between tables.
A primary key is the principal identifier of a row and must be distinct, non-null,
and immutable. In contrast, a unique key is a column or collection of columns that
has a unique value for each row and may be used to impose referential integrity
constraints or as a secondary identifier.
COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

ENTITY SET
An entity set is a group of similar kind of entities. It may contain entities
with attribute sharing similar values. Entities are represented by their
properties, which also called attributes. All attributes have their separate
values. For example, a student entity may have a name, age, class, as
attributes.

WEAK ENTITY SET


A weak entity is a type of entity which doesn’t have its key attribute. It can be
identified uniquely by considering the primary key of another entity. For that,
weak entity sets need to have participation.
COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

RELATIONSHIP SET
A relationship set is a set of relationships of same type. 

EXAMPLE

ATTRIBUTES
Attributes are the properties which describes the entities of an entity set.

 There are several types of attributes.


COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

For Participation Constraints-


 
Participation constraint defines the least number of relationship instances in which
an entity has to necessarily participate.
There are two types of participation constraints-
 

 
1. Partial participation
2. Total participation
 
1. Partial Participation-
 
COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

Partial participation is represented using a single line between the entity set and
relationship set.
 
2. Total Participation-
 
Total participation is represented using a double line between the entity set and
relationship set.
 

For Specialization and Generalization


 Generalization is a process of forming a generalized super class by extracting the
common characteristics from two or more classes.
 Specialization is a reverse process of generalization where a super class is
divided into sub classes by assigning the specific characteristics of sub classes to
them.
 

For Cardinality Constraints / Ratios-


COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

 Cardinality constraint defines the maximum number of relationship instances in


which an entity can participate.
There are 4 types of cardinality ratios-
 

 
1. Many-to-many cardinality (m:n)
2. Many-to-one cardinality (m:1)
3. One-to-many cardinality (1:n)
4. One-to-one cardinality (1:1)
 
 For Cardinality Constraints / Ratios-
 Cardinality constraint defines the maximum number of relationship instances in
which an entity can participate.
There are 4 types of cardinality ratios-
 
COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

 
1. Many-to-many cardinality (m:n)
2. Many-to-one cardinality (m:1)
3. One-to-many cardinality (1:n)
4. One-to-one cardinality (1:1)
 
COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

 For Cardinality Constraints / Ratios-


 
Cardinality constraint defines the maximum number of relationship instances in
which an entity can participate.
There are 4 types of cardinality ratios-
 

 
1. Many-to-many cardinality (m:n)
2. Many-to-one cardinality (m:1)
3. One-to-many cardinality (1:n)
4. One-to-one cardinality (1:1)
 
COURSE: DATABASE MANAGEMENT ASSIGNMENT 1
INDEX NUMBER: PS/CSC/21/0061

You might also like