Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Concept of Keys

And Fundamental Sets of


requiremen

Theoretical Notations
keys
index
types
types

types
t

DESIGNED BY ADARSH GUPTA


201474518
Today we will learn
 Concepts of keys.
requiremen

• What are the keys in DBMS?

index
keys
types
types
types

• Types of keys in DBMS.


t

• Why are keys required?


 Fundamental sets of theoretical
notations.
• Relation
• Domains
• Attributes
• Tuples
What are keys in DBMS?
A key in DBMS is an attribute or a set of attributes that
help to uniquely identify a tuple (or row) in a relation
(or table). Keys are also used to establish relationships
requiremen

between the different tables and columns of a relational

index
keys
types
types
types

database. Individual values in a key are called key


t

values.
Why are keys required?
• A key is used in the definitions of various kinds of integrity
constraints. A table in a database represents a collection of
records or events for a particular relation. Now there can be
thousands and thousands of such records, some of which may

keys t
requiremen
be duplicated.

about
types
types
types

• Let us take a real-life example of the database of each student


studying in an engineering college. What attribute of the
student do you think will uniquely identify each of them? You
could refer to a student by using their name, department, year
and section. Or, you can mention only the university roll
number of the student, and you can get all the information
from that.
• A key could either be a combination of more than one attribute
(or columns) or just a single attribute. The main motive of this
is to give each record a unique identity.
Types of keys in DBMS?

• There are broadly seven types of keys in DBMS. All


these types of keys in SQL must be implemented

requirement
appropriately for the relevant database to negate

index
types
types

types

keys
redundancy. Correct identification will lead to
database accuracy, improving results in a limited
time.
• Let’s explore these DBMS keys to learn more about
what are keys in SQL .
o Super key
o Candidate key
o Primary key
o Alternate key
o Foreign key
Super Key
A super key is a combination of
all possible attributes that can
uniquely identify the rows (or
tuple) in the given relation.
Super key is a superset of any
candidate key.

Candidate Key

requirement
A candidate key is an attribute or
set of an attribute which can

index
types

keys
types

types
uniquely identify a tuple. A
candidate key is a minimal super
key. Candidate keys are not
allowed to have NULL values.

Primary Key
A primary key is one of the
candidate keys chosen by the
database designer to uniquely
identify the tuple in the relation.
The value of primary key must
always be unique (not duplicate)
and can never be null.
Alternate Key
Out of all candidate keys, only one gets selected as primary key, remaining keys are
known as alternate keys.
In the Employee table, Emp_ld is best suited for the primary key. Rest of the attributes like
Aadhar_No, and Email_Id are considered as a alternate key.

requirement
notations

index
types

keys
types
types
Foreign Key
This key is used to link two tables together. It is an attribute (or set of attributes)
in one table that refers to the Primary Key in another table. The purpose of the
foreign key is to ensure (or maintain) referential integrity of the data.
Fundamental sets of theoretical
Remote Access
notations.
•VPN
Relation
It allows a user to connect to a private network and
access its services and resources remotely.
A relation • Itmeans
is usedaby 'TABLE'
home users (or private users) to bypass
consisting of regional
Rows andrestrictions
Columns.on the internet and to access
blockedasites.
Each column assigned unique(Example:
name OpenVPN, Cisco’s
notations

notations

requiremen
and must have atomic (indivisible)
AnyConnect VPN, etc.)

index
keys
types
types
types
value. Also, every row must be
unique (can't have two rows with
Site-to-Site VPN

t
exactly the same values for all their
fields).
Domains
• Also called Router-to-Router VPN, it is mostly used in
corporate. In this type of VPN, one router acts as VPN
A domain is client
a uniqueand set/pool
other asofVPN server. (Example: Nord VPN,
values from while
Expressthe actual
VPN, values
etc.)
in a particular
• When multiple Each
cell is derived.
offices of same company are connected
domain contains a set of data related
to a VPN, It’s called an “Intranet VPN”.
to a specific purpose.
• And when computer uses a VPN to connect two offices
of different companies, it’s called an “Extranet VPN”.
Remote
Advantages Access
•VPN
Attributes
It allows a user to connect to a private network and
• Bypass Geo-locked Content
access its services and resources remotely.
• Secure Wi-fi connection

Each column •It isa used
Table by
inPrevent is home
called users (or private users) to bypass
ISP Tracking
regional restrictions on the internet and to access
Attribute or Field.
• Mobility
An Attribute•blocked sites. (Example:
(oneMedia OpenVPN, Cisco’s

notations
notations

requiremen
is a field
Unblock Social
Column). AnyConnect VPN, etc.)
• Online Banking and Shopping Security

index
keys
types
types
types
Site-to-Site VPN

t
Disadvantages
Tuples
• Also called Router-to-Router VPN, it is mostly used in
•corporate.
With some InVPNs,
this typeyour
of connection can beacts
VPN, one router slower
as VPN
Each Rows in•client
a Table
Certain isother
called
andwebsites as block VPN users
VPN server. (Example: Nord VPN,
Tuple or Record. A Tuple
•Express
VPNs are
VPN, isetc.)
illegal a or questionable in some countries
record (one row).
• •When
There’s no wayofficesto know how well a VPN
multiple of same company areencrypts your
connected
todata
a VPN, It’s called an “Intranet VPN”.
• •And
Some VPNs
when log anduses
computer sell adata
VPN to to
third parties
connect two offices
of different companies, it’s called an “Extranet VPN”.
Thanks for
your attention

You might also like