DBMS
DBMS
in Magh Mela
ANKIT LAL-IMB2022006
SHARDUL DYUNDI-IMB2022010
ANKIT KUMAR-IMB2022035
MAYANK VERMA-IMB2022042
RAJEEV KUMAR-IMB2022045
INTRODUCTION
An Entity Relationship (ER) Diagram is a type of flowchart that illustrates how
“entities” such as people, objects or concepts relate to each other within a system.
Candidate
Key
Surrogate Primary
Key Key
Type
Composite
Key of Keys Foreign
Key
Alternate
Super Key
Key
Types Of Key
Primary The primary key refers to a column or a set of columns of a table that helps us identify all the records
Key uniquely present in that table. A table can consist of just one primary key
A super key refers to the set of all those keys that help us uniquely identify all the rows present in a
Super Key table. It means that all of these columns present in a table that can identify the columns of that table
uniquely act as the super keys.
Candidate The candidate keys refer to those attributes that identify rows uniquely in a table. In a table, we select
Key the primary key from a candidate key.
Alternate As we have stated above, any table can consist of multiple choices for the primary key. But, it can only
Key choose one. Thus, all those keys that did not become a primary key are known as alternate keys.
We use a foreign key to establish relationships between two available tables. The foreign key would
Foreign Key require every value present in a column/set of columns to match the referential table’s primary key. A
foreign key helps us to maintain data as well as referential integrity
Composite The composite key refers to a set of multiple attributes that help us uniquely identify every tuple present
Key in a table.
Surrogate A surrogate key in DBMS is the key or can say a unique identifier that uniquely identifies an object or an
Key entity in their respective fields. It is the unique identifier in a database.
Types of Attributes
Simple Derived
Attributes- are Composite Attributes- are
those that Attributes- based on other
cannot be made up of attributes and
further divided two or more are not stored
into sub- simple directly in the
attributes. attributes. database.
Types of Cardinality
• One-to-one relationship
• One-to-many relationship
• Many-to-one relationship
• Many-to-many relationship
Participation Constraint
Total Participation-
Partial Participation-
specifies that each
specifies that each
entity in the entity set
entity in the entity set
must compulsorily
may or may not
participate in at least
participate in the
one relationship
relationship instance in
instance in that
that relationship set.
relationship set. Its is
Its is also known as
also known as
"Optional
"Mandatory
Participation".
Participation".
ER Diagram of
Parking System
First
Login- User
name Passwor
userna pass Mobile
Last User User id d no
me image
name name
Batch id
User
User
Mobil name
Login Customer
mobile
e no Administrator
address
Email id id
Manages
manage Last
1 s
M First
name
Parking Vehicle name
location Colour
Veh no
Reserve
Parking lot parking Vehicle
spot
Parking booked
id Parking Ticket
slot Had Vehicle no
Ticket Owner
been type
no. detail
Empty
slot Linked to Note:
Ticket Vehicle RTO Key Attribute
no. parked spot
Vehicle Derived Attribute
type Multivalued
Parking Registra
Paymen tion no Address Weak Relationship
spot no
t_Date Weak Entity
Paymen
Amount t id Cardinality 1-M
Composite Attribute
Tables
Parking_slot_R
Ticket_No eg_no Parking_Slot_type _slot_ID
Foreign key
Candidate key
Super key
• Each entity (Administrator ,login , customer, vehicle, linked to RTO, parking lot,
vehicle parked spot ) contains primary key ,Alternate key, Candidate key, Foreign key,
and super key.
• The entity Owner id, owner name, mobile no together represent foreign key
• All the entities vehicle, Parking lots, customer etc. are normalized and reduce
duplicity of records
• We have implemented indexing on each tables of Car Parking System tables for fast
query execution.
Thank You