Sei sulla pagina 1di 19

Database

Management CSEN - 3206


Systems
Module - I
Entity Relationship Model - 1

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 2 of 20


Recap…
1. DB and DBMS

2. Advantage of DBMS and its limitation

3. Describing data

4. Three-schema

5. Data independence

6. Data languages

7. Two-tier Architecture

8. Three-tier Architecture

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 3 of 20


Overview

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 4 of 20


Steps to design a Data Base

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 5 of 20


Steps to design a Data Base

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 6 of 20


Steps to design a Data Base

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 7 of 20


Steps to design a Data Base

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 8 of 20


E/R Model
• Designs are pictures called entity-relationship diagrams.

• Allows us to sketch the design of a database informally

• Defines the conceptual view of a database

• At view level, the ER model is considered a good option for designing databases

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 9 of 20


E/R Diagram : A First Look

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 10 of 20


Entity
• “thing” or object in the real world with an independent existences

• Either be physical existence or conceptual existence

• In an entity-relationship diagram, each entity set is represented by a rectangle.

Car

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 11 of 20


Attributes
• Attribute = property of an entity set.

✓ Generally, all entities in a set have the same properties


✓ Attributes are simple values, e.g. integers or character strings.

• Represented by an oval …..


name Age

Student

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 13 of 20


Type of Attributes
1. Simple vs Composite attributes : atomic vs subparts

2. Single-valued vs Multi valued attributes: one vs many

3. Stored vs Derived attributes : derived form stored

4. Null values : void (What are the different types)

5. Complex attributes : combination of composite and multivalued

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 14 of 20


Example
Identify….
1. Simple
2. Composite
3. Single-valued
4. Multi valued
5. Stored
6. Derived
7. Null values
8. Complex attributes

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 15 of 20


Concepts of different Keys
• An attribute or collection of attributes that uniquely identifies an entity among entity set.

For example, the roll_number of a student makes him/her identifiable among students.

• Super Key − A set of attributes (one or more) that collectively identifies an entity in an entity set.

• Candidate Key − A minimal super key is called a candidate key. An entity set may have more than
one candidate key.

• Primary Key − A primary key is one of the candidate keys chosen by the database designer to
uniquely identify the entity set.

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 16 of 20


Concepts of different Keys

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 17 of 20


Primary v/s Unique Key
Primary Key:
• cannot have a NULL value.
• Each table can have only one primary key.
• Primary key can be related with another table's as a Foreign Key.
• Primary key supports Auto Increment value.

Unique Key:
• Unique Constraint may have a NULL value.
• Each table can have more than one Unique Constraint.
• Unique Constraint can not be related with another table's as a Foreign Key.
• Unique Constraint doesn't supports Auto Increment value.

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 18 of 20


Key Exercise

Find out Primary key, candidate key, unique key, alternate


key, foreign key and super key ….

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 19 of 20


Next Class
• E-R Modeling Continued

CSEN-3206 DBMS (Only) || Aritra Saha || HIT – K || Spring - 2019 20 of 20

Potrebbero piacerti anche