0% found this document useful (0 votes)
9 views16 pages

Database

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views16 pages

Database

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

DATABASE: A database is an organized collection of

inter-related data, which helps in insertion, deletion,


and retrieval of data efficiently. The database is also
used to organize the data or information in the form
of tables, view, schemas, reports, etc.

DBMS : A database management system or DBMS is a


software used for creating and managing the data in
the database easily and effectively. It is basically a set
of programs that allow users to store ,
modify/update, and retrieve information from the
database as per the requirements. DBMS also
provide security and protection to the database.
DBMS acts as a middle layer between the database
and the user.
Example : MySQL, MS SQL Server, Oracle, SQL, etc.
Features of DBMS:
 Data Storage and Retrieval:
DBMS provides efficient mechanisms for storing
and retrieving data, often using structured formats
like table.
 Data Integrity:
DBMS enforces rules to maintain accurate and
consistent data, including data types, constraints, and
validation procedures.
 Concurrency Control:
DBMS ensures that multiple users can access and
modify the database simultaneously without
conflicting with each other.
 Data Security:
DBMS implements access control mechanisms to
protect sensitive data from unauthorized access.
 Backup and Recovery:
DBMS provides tools for creating regular backups
and recovering in case of system failures.
THREE LAYERS OR LEVELS OF THE DATABASE
MANAGEMENT SYSTEM:
• External level
• Conceptual level
• Internal level
1. External or view level: This is the highest level of
database abstraction. External or view level
describes the actual view of data that is relevant
to the particular user.
2. Conceptual or Logic level: The conceptual level
describes the structure of the whole
database .This level acts as a middle layer
between the physical storage and user view.
3. Internal or Physical level: This is the lowest level
of database abstraction. It describes how the data
is actually stored in database and provides
method to access data from the database.
Types of DBA
 Database Administrators (DBAs) can be classified
into several types based on their specific roles
and responsibilities within an organization. Here
are common types of DBAs:
1.System DBA(SDBA):
 System DBAs focus on the physical and technical
aspects of database management. They are
responsible for the installation, configuration, and
maintenance of the database software and
related tools.
2.Application DBA (ADBAs):
 Application DBAs concentrate on database design
and development aspects. They work closely with
developers and application architects to ensure
that the database structure supports the
application’s requirements.
3.Development DBA (DDBA):
 Development DBAs are specifically focused on the
development phase of the software life cycle.
4.Production DBA (PDBA):
 Production DBAs are responsible for the day-to -
day operational aspects of managing database in
a live or production environment.
5.Cloud DBA:
 With the increasing adoption of cloud
technologies, some DBAs specialize in managing
database hosted on cloud platforms.
6.Security DBA (SDBA):
 Security DBAs focus on implementing and
maintaining security measures for database. They
manage user access, permissions, and audit trails
to ensure data confidentiality and integrity.
7.Replication DBA:
 Replication DBAs specialize in setting up and
managing database replication. They implement
and maintain mechanisms to duplicate data
across multiple database or servers, ensuring data
consistency and availability.
8.Backup and Recovery DBA:
 Backup and Recovery DBAs are dedicated to
planning, implementing, and testing backup and
recovery strategies.
DATA MODELS
Data models are the models explaining the logical
structure of the database systems. They describes the
entities, attributes, and the relationship among the
data elements of the specified database.
Relational Data Model
The relational data model is a data model indicating the
structure of the database in the 2-D (2-dimensional)
tables. In this model, all the data or information given by
the user is stored in the table rows according to the
specific column.
Edgar Frank Codd (E.F. Codd) was a great scientist who
invented the relational model for the databases in 1970.
In the relational model, tables are called relations, and
rows and columns are called tuples and attributes.
ER MODEL
1)Entity
2)Attributes
3)Relationships

Entity
An entity may be an object, place, person, or an event which
stores data in the database. In an entity-relationship diagram, an
entity is represented by a rectangle. Student, course, manager,
employee, patient, etc. are examples of an entity.
Attributes: An attribute in an Entity-Relationship Model
describes the properties or characteristics of an entity. It is
represented by an oval or ellipse shape in the ER diagram. Every
oval shape represents one attribute and is directly connected to
its entity which is in the rectangle in shape.
For example, employee_id, employe_name, Gender,
employee_age, Salary, and Mobile no. are the attributes
which define entity type Employee.

Relationship
A relationship in Entity-Relationship Model is used to describe
the relation between two or more entities. It is represented by a
diamond shape in the ER diagram. For example, student study
in college, employee works in a department. Here, ‘study in’
and ‘works in’ are the relationships.
Normalization
• Functional Dependency (FD) determines the
relation of one attribute to another attribute in a
database management system (DBMS).
• X → Y (if X is same then Y has to be same)
• Emp_id → Emp_name
Rules of Functional Dependencies X->Y
• Reflexive rule – If X is a set of attributes and Y is
subset of X, then X holds a value of Y.
• Augmentation rule: When X -> Y holds, and c is
attribute set, then Xc -> Yc also holds. That is adding
attributes which do not change the basic
dependencies.
• Transitivity rule: This rule is very much similar to
the transitive rule in algebra if x -> y holds and y -> z
holds, then x -> z also holds. X -> y is called as
functionally that determines y.
• Union: If X → Y and X → Z then X → YZ
•Decomposition: If X → YZ then X → Y and X → Z
First Normal Form (1NF)
• Each attribute of a relation contains only an atomic value.
•No Multivalued attribute only single valued.
Second Normal Form (2NF)
• A relation must be in 1NF
• No partial dependency should exist in the relation

Third Normal Form (3NF)


• A relation must be in second normal form (2NF) And there
should be no transitive functional dependency exists for non-
prime attributes in a relation.

Boyce-Codd Normal Form (BCNF)


• A relation is in 3NF And for every functional dependency, X →
Y, L.H.S of the every functional dependency (X) be the super key
of the table. • R(ABCD) && FD: A->B, B->C, C->D, D->A

Fourth Normal Form


• A relation is in BCNF.
• And, there is no multivalued dependency exists in the relation.

Fifth normal form (5NF)


• A relation is in 5NF if it is in 4NF and not contains any join
dependency and joining should be lossless.
• No spurious tuples
• 5NF is also known as Project-join normal form (PJ/NF)
What is Key
• A DBMS key is an attribute or set of an attribute which helps you to identify a
row(tuple) in a relation(table).
Types of Keys
• Candidate Key
• Primary Key
• Alternate Key
• Super Key
• Foreign Key
Candidate Key
• CANDIDATE KEY is a set of attributes that uniquely identify tuples in a table
• The Primary key should be selected from the candidate keys.
• Every table must have at least a single candidate key.
• A table can have multiple candidate keys but only a single primary key.
Primary Key
• Unique + Not Null
• Only one in a table
• Can be composite
Alternative key
• Candidate Key – Primary Key
Super Key
• Super Set of Candidate Key
• Must contain Candidate key + Anything
Foreign Key
• FOREIGN KEY is a column that creates a relationship between two tables
• Can have duplicate values
• Maintain Referential Integrity
SQL
SQL (Structured Query Language) is used to perform
operations on the records stored in a database such
as updating records, deleting records, creating and
modifying tables, views etc.
SQL Data Types

In SQL DATA TYPES, each column holds value. Data


types can be an integer type, character type, etc., and
such data is stored in the database table.
The data type is a source for SQL columns to
understand which kind of records to be added to the
table columns. Suppose we have table name
employee, and we store employee id then we have to
declare the numeric data type.

SQL DATA TYPES are classified into three different


types:
1. String Data Types.
2. Numeric Data Types.
3. Date and Time Data Types.
Types of Commands
Database Security
Security of databases refers to the array of controls, tools,
and procedures designed to ensure and safeguard
confidentiality, integrity, and accessibility. This will
concentrate on confidentiality because it's a component
that is most at risk in data security breaches.
Security for databases must cover and safeguard the
following aspects:
o The database containing data.
o Database management systems (DBMS)
o Any applications that are associated with it.
o Physical database servers or the database server
virtual, and the hardware that runs it.
o The infrastructure for computing or network that is
used to connect to the database.
Common Threats and Challenges
Numerous software configurations that are not correct, weaknesses, or patterns of carelessness or abuse can
lead to a breach of security. Here are some of the most prevalent kinds of reasons for security attacks and the
reasons.

Insider Dangers
An insider threat can be an attack on security from any three sources having an access privilege to the
database.

o A malicious insider who wants to cause harm


o An insider who is negligent and makes mistakes that expose the database to attack. vulnerable to
attacks
o An infiltrator is an outsider who acquires credentials by using a method like phishing or accessing
the database of credential information in the database itself.

Insider dangers are among the most frequent sources of security breaches to databases. They often occur as a
consequence of the inability of employees to have access to privileged user credentials.

Human Error
The unintentional mistakes, weak passwords or sharing passwords, and other negligent or uninformed
behaviours of users remain the root causes of almost half (49 percent) of all data security breaches.

Database Software Vulnerabilities can be Exploited


Hackers earn their money by identifying and exploiting vulnerabilities in software such as databases
management software. The major database software companies and open-source databases management
platforms release regular security patches to fix these weaknesses. However, failing to implement the
patches on time could increase the risk of being hacked.

SQL/NoSQL Injection Attacks


A specific threat to databases is the infusing of untrue SQL as well as other non-SQL string attacks in
queries for databases delivered by web-based apps and HTTP headers. Companies that do not follow the
safe coding practices for web applications and conduct regular vulnerability tests are susceptible to attacks
using these.

You might also like