Sunteți pe pagina 1din 18

Database Analysis-Unit-1I

Course Name: Faculty Name:


Database Zaiba Khan
Management
System Assistant
Branch- Professor(CSE)
School of
B.Tech V Semester
Engineering &
Course Code: Technology
19007800
ER-Model(Symbols)

 ER modeling uses the following symbols:

Represents
Rectangle
Entity Set
Representing
Oval
Attributes
Represents the
relationship
Diamond
among entity
set
Links attributes
to entity sets
Line
and entity sets
to relationships
ER-Model(Example)

 Consider the entity relationship diagram shown


below:
ER-Model(Example)

 Consider the entity relationship diagram shown


below:
◦ Customer and Account are related through binary
relationship set Cust_Acct
◦ The attributes of Customer are
 Cust_Name
 Cust_No
 State
 City
◦ The attributes of Account
 Acc_No
 Balance
Database Design using ER-Model

A database conforms to an E-R diagram can be


separated by a set of tables
 For each entity set and for each relationship set
in the database
◦ There is a unique table which is assigned the name of
corresponding entity set or relationship set
 Each table has a number of columns which are
given a unique name
Strong and Weak Entities

 Dependent Entities (also called Weak Entities)


 Independent Entities(also called Regular or
Strong Entities)

◦ The one whose existence depends on another entity, it


can be weak entity or strong entity—Dependent
◦ A weak entity set does not have sufficient attributes
to form a primary key

 A WEAK ENTITY set is represented by double outline


rectangle in E-R diagram
Strong and Weak Entities
Strong and Weak Entities

 Consider an entity type MARKS which


represents the marks obtained by a student
 Now the existence of MARKS depends upon
the existence of entity type STUDENT

 Every weak entity set can be converted to


a strong entity set by adding appropriate
attributes
Strong and Weak Entities

 An entity set which has a primary key is


termed as a strong entity set
 As the figure shown, the entities EMPLOYEE
and STUDENT are strong entities , because they
have the primary keys Emp_No and Adm_No
Strong and Weak Entities(Example)
SuperClass and Subclass Types
What is Class?
◦ It is best understood with an analogy

◦ For Example,
 Out of the several objects in a room , Lets talk about the picture
on the wall
 There is a class, which we can call the class of “Pictures” of
which the picture on the wall is an instance(meaning an
occurrence or example)
 The picture in the room belongs to the class of pictures , which
consists of all pictures in the world
A set of objects that share a common
structure and a common behavior is called
class
SuperClass and Subclass Types
What is an Object?
◦ In a layman language, an object is something
that has a fixed shape or well defined
boundary

◦ If you look around , you would notice several


objects of varying descriptions
◦ They may be connected to or related to
adjacent to a PC

An OBJECT is something which is capable


of being seen ,touched and sensed
SuperClass and Subclass Types
INHERITANCE
◦ The methods and/or attributes defined in an object
class which can be inherited or reused by another
object class

◦ A class Supertype is an object whose instances store


attributes that are common to one or more class
subtypes of the object
◦ A class Subtype is an object class whose instances
inherit some common attributes from a class
supertype and then add other attributes that are
unique to an instance of the subtype
◦ Inheritance is always transitive i.e. can be transferred
◦ A class can inherit features from superclass many
levels away
SuperClass and Subclass Types

 Inheritancemeans that the behavior and data


associated with child classes are always an
extension of the properties associated with
parent class

A subclass must have all the properties of the


parent class, and other properties as well

A class whose objects store attributes which


are common to its subclasses , is known as the
SUPERTYPE class
SuperClass and Subclass Types
(Example)

A class shopkeeper is a supertype


 Its object store attributes which are common to
all shopkeepers like bakers, grocers, stationers,
toy stores , etc
 These shopkeepers belong to the supertype
class, Shopkeeper

 The class subtype is the class which inherits


qualities from a supertype class and also adds
on its own qualities
◦ The florist inherits all the qualities that a shopkeeper
should have. In addition he also has its own qualities
like he sells flowers, etc
SuperClass and Subclass Types
SuperClass and Subclass Types

 The
concept of Inheritance is also known as
Generalization/Specialization

 Supertype= Generalization class


 Subtype= Specialization class

 Example, Furniture is referred as


Generalization
Whereas, Chair, Table and Cupboards are
specialization classes
SuperClass and Subclass Types

 It’s
a kind of technique wherein the attributes
and behaviors that are common to several
types of object classes are grouped into their
own class, called a super type

 The attributes and methods of the supertype


object class are then inherited by those object
classes.

S-ar putea să vă placă și