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

Notes of Database Systems

9-1-2024
Data: Collection of raw facts and figure. Database:Collection of data stored in an efficient /
organised way.
We collect data in two ways
Structured database:
Structure database is a data that is stored in well-defined format typically using tables with rows
and columns.,makes it sure that data is consistent. Example: include SQL-based databases
Unstructured database:
Unstructured database is that which is stored in its native form(like without using specific
format). Example: Not included SQL-based databases
There are two types of management systems
11-1-2024
1.File Management System:
A file management system is used for file maintenance (management )operations. It is a type of
software that manages data files in a computer system. A file management system has limited
capabilities and is designed to manage individual or group files, such as special office
documents and records. It may display report details. A file management system is also known as
a file manager
2.Database Management System:
Database:we called it the mixture of Data and Records:Data is raw information,record is
collection of organised information.
> Record:

Roll Name Age


01 ABC 19
> Tables/Relations:We collected records in form of relations(In database tables are called
relations)

Roll Name Age


01 ABC 19
02 PQR 22
03 XYZ 24
● The columns of the relation(table) are called field ,attributes or domains
● The rows are called tuples or records
Database is collection of related relation(relation/tables are collection of records)
Table 1:

Roll Name
01 ABC
Table 2:

Roll Name Age


01 ABC 19
02 XYZ 20
Table 3:

Roll Name Address


01 ABC Typ
02 XYZ Wsf
These 3 tables,we can called them related collection of relations
Entity:Anything that can be stored in database as a record in form of tables
Attribute:The things that can be stored about an entity like Roll,Name etc.
Hierarchy of database: Data>Record>relations(tables)>database.
16-1-2024
In Database we have to Edit/Update,enter/insert,delete,view,share,So for these operations we use
a software ,the combination of database and the software are called as database management
system
Difference btw DBMS and FMS
DBMS File Management Systems
DBMS is a system software for A file management system is a
creating and managing databases software that manages data files in
that provides a systematic way to a computer system.
create, update and manage data.
Data Redundancy is when multiple copies of the same information are stored in more than one
place at a time

Data redundancy is low in a DBMS. In a file management system, data


redundancy is high.
Consistency is the accuracy, completeness, and correctness of data stored in a database. The
same data across all related systems, applications, and databases

In DBMS, the data consistency is Data consistency is low in the file


high. management system.
Data Sharing

Sharing data is easier in DBMS. Sharing data is harder in file


management system.
Integrity is assurance of data accuracy and consistency

Data integrity is high in DBMS. In file management system, the data


integrity is low.
Operations

Updating, searching, retrieving data Updating, searching, retrieving data


is easier in DBMS because of is harder in a file management
queries. system.
Security

In DBMS, the data is more secure. Data is not very secure in file
management system.
Backup of recovery Process

Backup and recovery process is Backup and recovery process is


complex in a DBMS. simple in a file system.
Number of users

DBMS is suitable for large File management system is suitable


organizations to support multiple for small organizations or single
users. users
The difference between DBMS and File Management System is that a DBMS stores data to the
hard disk according to a structure while a file management system stores data to the hard disk
without using a structure. DBMS provides data sharing, and it is more flexible than a file
management system.
19-1-2024
We use layers or data abstraction in structure of database from users for its safety and this have
three levels
Types of database Architecture
There are 3 types of data Architecture:
– In 1-Tier Architecture the database is directly available to the user, the user can directly
sit on the DBMS and use it that is, the client, server, and Database are all present on the
same machine
Advantages of 1-tier architecture is that it has simple architecture,they are cost effective and
easy to implement
In 2-tier architecture there are two main parts: the part you see and interact with (like a website
or an app), and the part that handles data behind the scenes (like a database). Imagine it like a
two-story building: the bottom floor (tier) stores and manages all the data, while the top floor
(tier) is where you do your work or interact with the system.
Advantages of 2-tier architecture
● It is easily understandable and simple because of only two components
● It makes easy access to database which makes fast retrieval,it is cheaper than 3-tier
architecture
In 3-tier Architecture there are three layers: the presentation layer (user interface), the
application layer (business logic), and the data layer (database). The presentation layer interacts
with the user, the application layer processes user requests and communicates with the data
layer, and the data layer manages the storage and retrieval of data.
Advantages of Three-tier architecture is that it offers scalability, flexibility, and enhanced
security for better performance and easier maintenance.
Disadvantages are that It introduces complexity(because of more layers), increased cost, and
overhead due to managing multiple layers.
23-1-2024
Structure Of Database
The structure of database includes:
. Tables: These are like spreadsheets where data is organized into rows and columns. Each
table represents a specific type of information, such as customers or products
. Columns: Also known as fields or attributes, columns represent the different types of
information stored in a table. For example, a "Customers" table might have columns for
"Name," "Email," and "Address."
. Rows: Also known as records or tuples, rows represent individual instances of data within
a table. Each row contains a set of values corresponding to the columns.
. Keys:These are like special codes that help identify each row uniquely, ensuring there are
no duplicates.
. Indexes: Indexes are used to quickly locate data within a table. They are similar to the
index of a book, allowing for fast lookups based on specific criteria.
. Constraints: These are rules to keep data accurate, like ensuring a phone number is
always in the correct format
. Views: Views are like custom filters that show you only the information you need, without
changing the original data.
. Relationships: Relationships define how data in different tables are related to each other.
Common types of relationships include one-to-one, one-to-many, and many-to-many
Types of Database
1.File management system
A file management system (FMS) is like a digital organizer for your computer files. It helps you
keep your files organized in folders, allows you to perform actions like opening, editing, and
deleting files, and helps you find and share files easily. It's like the filing cabinet for your digital
deleting files, and helps you find and share files easily. It's like the filing cabinet for your digital
documents.
2.Hierarchical Database System
Hierarchical data systems organize data in a tree-like structure, where each piece of data has a
parent-child relationship. Think of it like a family tree, where each person (or data element) can
have one parent (above) and multiple children (below). This structure is commonly used in file
systems, where folders (parents) contain files (children), and each folder can have subfolders,
creating a hierarchical organization.
3.Network database System
A network database system is like a web like a network where data points are connected to each
other. Each point can have many connections, allowing for complex relationships between
different pieces of information
4.Relational Database System
A relational database system is like a digital spreadsheet where you organize information in rows
and columns. Each row represents a specific item, like a customer or a product, and each column
holds different details about that item, like their name, age, or price. You can use this system to
easily store, search for, and update information, making it handy for things like managing or
keeping track of customers.
Data Models
Are used to describe your data. Or collection of conceptual tools for describing data,their
relationship,consistency,concentrates.
Data models provide a way to describe the design of database at physical,logical and view level.
● Relational Model: The relational model organizes data into tables with rows and columns,
similar to a spreadsheet. Each row represents a unique record, like a person or a product,
and each column represents a specific attribute or characteristic, like a name or a price.
Relationships between tables are established using keys, making it easy to link related
information together. It's like organizing information in a structured and easy-to-access
format, commonly used in databases like Excel or SQL-based systems
● Entity Relationship Model: The entity-relationship (ER) model is like a map that shows
how different things are connected. In this model, entities are like objects, such as people,
places, or things, and relationships show how these entities are related to each other. For
example, in a school database, "students" would be an entity, and "enrolled in" would be a
relationship showing how students are connected to the courses they're taking. It helps
organize and understand how different pieces of information relate to each other in a
database.
● Object-Based Data Model: Anything that can be programmed using programming
language called object. An object-based data model is a way of organizing and
representing information in a computer system using digital objects. Each object contains
data (attributes) and methods that describe it, similar to how real-world objects have
characteristics and actions. This model allows for more natural representation of complex
data structures and relationships, making it easier to work with data in programming
languages that support object-oriented concepts.
● Semi-Structured Data Model: is a way of organising and storing same thing in different
types. You can have different types of data with different formats or structures, making it
easier to handle diverse kinds of information.
25-1-2024
DataBase languages
A language that are used to defined database system is called database language
(1) Data Manipulation language: DML is a language that enables users to access data like
– Insertion(Enter) of new information into database
– Retrieval(locates) of information stored in the database
– Deletion of information from the database
– Modification(update/changing) of information stored in database
By using the appropriate data model.
There are basically two types of DML
● Procedural DMLs allows a user to specify(identify/describe) what data are needed and
how to get those data
● NonProcedural/Declarative DMLs allows a user to specify what data are needed without
specifying how to get those
Declarative are easier than a procedural DMLs. Since user doesn’t have to specify how to get
data,database system has to figure out an efficient way of accessing data.A Query is a
statement requesting to locate the information. The portion of DML that involves information
retrieval is called a Query Language.
(2) Data-Definition Language: DDL is a language for describing and managing relationships of
data in database. It refers to SQL command that create,modify and delete data structures.It
Performs
– Assertion: Assertion in DDL are like rules or conditions that you set for your database.
They ensure that certain requirements are always met when you add or change data.
– Deleting Objects: Remove unnecessary Database objects like delete tables ,indexes etc.
– Defining Constraints: Set rules to maintain data integrity .
– Creating Objects: Create Tables, Views or other database objects.
Why we use DBMS
We use DBMS because it helps to :
● Organize data neatly.
● Keep data accurate and consistent.
● Secure data from unauthorized access.
● Handle large amounts of data easily.
● Recover data if something goes wrong.
● Access data quickly and efficiently.
Difference btw DBMS & RDBMS
DBMS is DataBase Management System.
RDBMS is Relational Database Management System.(Is a type of DBMS)

DBMS RDBMS
It Stores data in form of file It Stores data in form of tables
Data items need to access Multiple data items can be
individually accessed same time
DBMS doesn’t support distributed RDBMS supports distributed data
data
Security is less More security measures provided
It deals with small amount of data It deals with large amount of data
16-2-2024
ER modeling(Top down Approach)
What is ER Modelling.?
A graphical technique or design that can later be implemented as a database
Entity
Anything that can be stored in database.Represented as Rectangle
Entity instances Ways to store entities
Regular Entity that have an student. It can take only one value for a particular student.
Multi-valued Attributes If an attribute can take more than one value for each entity, it is a multi-
valued attribute. Multi-valued example for multi valued attribute : telephone number of an
employee, a particular
employee may have multiple telephone numbers.
Stored Attribute An attribute which need to be stored permanently is a stored attribute
Example : name of a student
Derived Attribute An attribute which can be derived automatically from other attributes is a
derived attribute. Example: age of employee which can be calculated from date of birth and
current date.
Relationship
Relation between entities and data sets is called relationship
Degree of Relationship
The degree of relationship in a database refers to the number of entities participating in a
relationship.
● Unary Relationship: Involves a single entity type.
● Binary Relationship: Involves two different entity types.
● Ternary Relationship: Involves three different entity types.
It describes how entities are connected to each other in the database.
Cardinality of Relationship
The cardinality of a relationship in a database is like how many items are connected in a
relationship.
● One-to-One (1:1): Each item on one side is connected to exactly one item on the other
side.
● One-to-Many (1:N): Each item on one side can be connected to multiple items on the
other side.
● Many-to-One (N:1): Many items on one side can be connected to one item on the other
side.
● Many-to-Many (N:N): Many items on one side can be connected to many items on the
other side.

You might also like